Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I have made several personal configuration changes to a Raspbian Wheezy install (more secure ssh, personal configurations, etc). It's been a couple weeks since I last touched it, and I completely forgot the password to login. What should I do?

share|improve this question
    
Might I suggest this post be edited to just "How do I change my password?" as it might have more use for people. (Easier to find) –  bearbin Jan 9 '13 at 18:34
    
I figured there were a lot of "How do I change my password" posts already. Haha, this was specifically for my super niche situation. Maybe there's middle ground... –  loeschg Jan 9 '13 at 19:10
    
@bearbin Please note you can suggest directly your edit by clicking on "edit". More info: meta.raspberrypi.stackexchange.com/q/347/797 –  Morgan Courbet Jan 10 '13 at 8:59
add comment

2 Answers

Right off the bat, let me say that there is not a way to recover a password (without some actual cracking/hacking which I don't know how to do). Resetting your password is your best bet.

So the first step will be to determine if you have any way to log in to the RPi.

If you're able to log in with a user that has 'sudo' rights (this includes SSH... perhaps you have keys set up properly but forget the actual user password, which I ran in to), simply typing:

sudo pwd

should prompt you to create a new password (without having to enter your current password).

Another option would be to run the starting config and change the password that way.

sudo raspi-config

If you're completely locked out, you can try the technique mentioned here, though I didn't have any success with the strategy. It just kept me from finishing booting up the RPi.

I haven't found any good techniques to enable root access period (putting the conversation of why you'd even want to do that aside :) ), let alone if you can't log in. Somebody can correct me if I'm wrong.

Hopefully this will save you from blowing away an image with a fresh one. If this saves one person, figure it's worth the time to post :)

share|improve this answer
add comment

Same problem. Found a solution here: http://ekuric.wordpress.com/2013/01/20/raspbian-wheezy-root-password/

But, in short, mount the SD card, go into the file system, and edit /etc/passwd. There's a line with "root" that looks something like this:

root:x:0:0...

Get rid of the x; leave the colons on either side. This will eliminate the need for a root password.

So login as root; it didn't ask for a password for me. Then, reset your "pi" (or whatever username) password:

passwd pi

And then when it prompt, set your new desired password (and confirm it).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.