Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 have ubuntu server on AWS(amazon web services) EC2 . I access it remotely through Putty service on my windows. Unfortunately i have changed the username 'root' to some other editing the file /etc/passwd. Now i am unable to login through any user name. If i give username as 'root' or other it does not accept it but if i give it new username, it ask for the password, saying [Authenticating with public key "imported-openssh-key"], on giving password it gives alert "Authentication failed."

anyone! please help me to solve this problem. thanks in advance

share|improve this question
I think you've made an error during manual modification of /etc/passwd. I recommend using tools like usermod for user management or be more careful when doing manual edits. – Lekensteyn Oct 18 '11 at 10:39

Best chance you have is to use the livecd but for that you need physical access to the server.

You need to mount those partitions somehow and remotely you have no choice.

Don't think there is any other options. If you can have physical access to it use the livecd to boot a desktop, mount your HDD and on a terminal type:

sudo nano <pathtoyourmounteddisk>/etc/passwd

Look for a line like this:


change it to:



sudo restart

You should now go to single user mode and be able to change the root password.

share|improve this answer
dear i mentioned i am accessing the server remotely:-( – Mujtaba Haider Oct 18 '11 at 11:01
dear??? (nvm) Sorry, then there is no options for you :( – Bruno Pereira Oct 18 '11 at 11:03
Fixed it o include all your options, no cookies for you! – Bruno Pereira Oct 18 '11 at 11:06

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.