0

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

1
  • 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, 2011 at 10:39

1 Answer 1

1

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:

root:encryptedpasswordgoeshere:0:0:ALL,ALL:/:/bin/sh

change it to:

root::0:0:ALL,ALL:/:/bin/sh

Reboot

sudo restart

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

3
  • dear i mentioned i am accessing the server remotely:-( Oct 18, 2011 at 11:01
  • dear??? (nvm) Sorry, then there is no options for you :( Oct 18, 2011 at 11:03
  • Fixed it o include all your options, no cookies for you! Oct 18, 2011 at 11:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .