help needed with username and password

Asked by medathen

I brought a second hand computer and when I got home it has Ubuntu on it. The computer is asking for a username and password. The lady I brought the computer from has no idea what the username or password is. Is there anything I can do to create a new username and password so that I may use the computer.

Any help would be appreciated.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jim Hutchinson (jphutch) said :
#1

Well, a couple of thoughts.

One, if the computer was set up by someone else (and not for the purpose of resale), you may want to wipe the HD and reinstall it yourself. There is no way to know how secure the install is or what sort of apps could have been installed. Whose to say it wasn't set up to collect personal data and forward it to someone else. Of course, if you know and trust the person that may not be an issue.

If you want to use the current install, you can reset the password fairly easily. At the GRUB boot loader menu (if this doesn't show you may need to press esc) choose the option for "recovery mode". This will give you a text base, administrator or root shell. From here you can do just about whatever you want. If you know the username that was used, at the shell prompt type

passwd <username>

and enter a new password. You should be good to go now.

If you don't know the user name either you might be able to find it my looking in the /etc/shadow file. There may be other ways as well but I don't know any. From the shell prompt, open the file. You are in a text environment so you need to use a text editor. Do this

nano /etc/shadow

That will open up a text editor and the file. Scroll through looking for something that looks like username. It also includes what I believe are encrypted versions of passwords. Username passwords in my experience are longer and "different" looking from the other "users" listed there. That longer, different line is probably a user. Once you know that you can go back to the above step and reset the password.

Of course, you could also set up a new user account but it would be best to discover and gain access to the original user account since that is the one set up by default to be the admin. If you can't "hack" into the OS it would probably be best to reinstall. My thoughts anyway.

Can you help with this problem?

Provide an answer of your own, or ask medathen for more information if necessary.

To post a message you must log in.