Computing.Net > Forums > Linux > Forgot username/password-locked out

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Forgot username/password-locked out

Reply to Message Icon

Name: MordredHaidar
Date: September 9, 2005 at 15:24:42 Pacific
OS: Ubuntu 5.04
CPU/Ram: N/A
Comment:

So, I've just done the dumbest thing ever...I've locked myself out of Ubuntu. Either the username or password I'm thinking should work isn't, I've tried just about everything it could be...so now I havew to work around it. Is there anything I can do that's quicker than reinstalling it?

Celeron Eater



Sponsored Link
Ads by Google

Response Number 1
Name: Paracomp
Date: September 9, 2005 at 18:11:08 Pacific
Reply:

Get a floppy or cd-rom bootable version of Linux such as knoppix. Boot that; then mount the hard drive such as #mount /dev/hda1 /mnt
Edit the /etc/password file for the user which will now be located as:
/mnt/etc/password. You might also need to remove (blank) the password entry for that user in /etc/shadow. You should b able to boot the original Linux and login.


0

Response Number 2
Name: Jake2
Date: September 9, 2005 at 23:27:33 Pacific
Reply:

First, the file is called /etc/passwd, not /etc/password. You should see your account name in the results of "tail /etc/passwd".

If Ubuntu uses GRUB, and I'm reasonably sure it does, all you have to do is press "e" when it briefly pauses before booting. You will then be able to edit the boot options. Go to the end of the line and enter "init=/bin/bash". This will bypass all startup procedures and give you root access. Run the "tail /etc/passwd" command I mentioned earlier to identify your username. Your root filesystem will be mounted readonly, so you'll want to run "mount -o remount,rw /". Then set your password with "passwd yourusername".

It's possible to password protect GRUB. If you encounter this, use Paracomp's method. You will need to edit etc/shadow. If you completely remove the longest string of junk between two colons, your password will be removed. Reboot, login, and set a new password with "passwd".


0

Response Number 3
Name: Paracomp
Date: September 10, 2005 at 21:37:52 Pacific
Reply:

Thanks Jake for the correction of /etc/passwd
Trying to get over a bout of pneumonia.


0

Response Number 4
Name: 3Dave
Date: September 12, 2005 at 03:50:30 Pacific
Reply:

With Ubuntu, in the grub boot menu simply choose "recovery mode", this will boot you up to a root prompt without asking for a password. Then you can set a password for yourself as Jake says with "passwd yourusername".


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Forgot username/password-locked out

monitor locking out www.computing.net/answers/linux/monitor-locking-out/251.html

Username/Password in fstab www.computing.net/answers/linux/usernamepassword-in-fstab/8986.html

Lock out one user from a dir? www.computing.net/answers/linux/lock-out-one-user-from-a-dir/26113.html