Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

One of my colleague removed by error etc/passwd and etc/shadow files.

The problem is that now the system doesn't have any account.Impossible to connect by ssh or to work on it.

How can I create a root account?

share|improve this question

migrated from stackoverflow.com Jun 6 '13 at 20:59

This question came from our site for professional and enthusiast programmers.

2 Answers 2

If you have physical access then you could reboot with the kernel line as rw init=/bin/bash. This should give you root access to recreate the user accounts.

share|improve this answer

You might try to copy another computer's passwd and shadow, assuming you know what you're doing. And I hope you've kicked your colleague's butt ;-)

See this and this

share|improve this answer

Your Answer

 
discard

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