Use a framework that handles user accounts/passwords for you. Twitter, Facebook and other social auth frameworks can be plugged in easily via 3rd party modules.
I use and recommend Django, for example. I would imagine Ruby/Rails would have similar capabilities.
For Django tutorials/docs: http://docs.djangoproject.com/en/1.1/
Django is also about to release a major update in the first half of March (v1.2). Some GREAT improvements.