Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

How can i restore my /etc/passwd file? I have access to it, but it's currently empty and I added this to the file, but I can't even SSH to the machine, I'm getting a "connection refused".


Is it possible to recreate the passwd file? How should it be formatted, so that I can log in again?


Best regards

share|improve this question
Can you give the OS or, in the case of Linux, the distro and version that you are running? – Swoogan Dec 13 '09 at 2:39
up vote 1 down vote accepted

Lol on the stupidity tag. "Connection refused" usually means that sshd isn't running. Make sure the service is running. It may require the ssh user:

share|improve this answer
Yeah. Well. What can I say. Stupidity big time! But... IT WORKED! Thanks a million! But I'm still not completely up and running. Fx. I'm getting "timeout in locking authority file /root/.Xauthority". What other lines do I need for the system to function properly? Thanks in advance! – Kordonme Dec 12 '09 at 3:21

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.