Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I inherited a backup server running centOS 5. We recently went from a Windows Server System to a NAS System. No one knows what the username is or the password and I need to know these before I can set up the backup server on the NAS System. I have found a way to change the password to something I know and that has been done, but I still need to know how to change the username to something I know before I can set it up on the NAS and use it to backup all the computers and the NAS on our office network. Can anyone help me out? Ray

share|improve this question
What kind of access do you have to the machine? root or just a way to log in as the unknown user? In the latter case, who am i might be your friend. – Ulrich Schwarz Apr 28 '12 at 16:57
I can reboot it and then it goes straight to the log in screen. – Ray Apr 29 '12 at 3:09

This is easy actually, first of all get a linux machine and add a user with a password. Then look at /etc/shadow look for the username, it has a very long hash behind it, copy it.

Now boot a live disk on your centOS machine and mount the disks. Look for the user in the centOS's /etc/shadow file, replace that hash with the hash you generated before. So now you know:

  • username (saw it in the /etc/shadow file)
  • password (it's the one you generated)
share|improve this answer
This is the only linux machine that we have, do i have to use a second machine running linux? – Ray Apr 29 '12 at 3:12
just get a live disk – Lucas Kauffman Apr 29 '12 at 6:58
/etc/shadow would have the password hash, not /etc/passwd. You can tell because the lines in /etc/passwd will end with a * or a x. – Joseph Kern Apr 29 '12 at 19:08
oops, fixed that :) – Lucas Kauffman Apr 29 '12 at 19:13

Anther way is to boot into recovery mode: (link) and check the /etc/passwd for username, and change the password for it with :

passwd <username>
share|improve this answer

Your Answer


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.