Reset user passwd when you don't know it

4

2

I have a small problem. I have shared keys setup on my domain, so I never type my password to login anymore.

I've forgotten my password now. This is a problem because only my user can sudo. Password authentication for root has been disabled, so without my password, I cannot do maintenance on my web server.

Is there a way to reset my password as my [now only] key-authenticated user?

Specifically, can this be done on CentOS 4?

warren

Posted 2010-05-28T13:28:57.957

Reputation: 8 599

Answers

3

Aside from finding and exploiting a serious security vulnerability in Linux, I can't see how there could be a way to do this without physical access.

SamsLembas

Posted 2010-05-28T13:28:57.957

Reputation: 141

1I was somewhat afraid of that :-\ ...looks like I'l need to open a support case with my host to have them reboot to init 1 and fix the root password for me :( – warren – 2010-06-02T14:12:53.253

1

I have not done this in a long time so I might be wrong. You can reset the password by rebooting into single-user mode.

Here are some links:

http://www.linuxtopia.org/online_books/centos_linux_guides/centos_linux_step_by_step_guide/s1-q-and-a-root-passwd.html

http://www.centos.org/docs/5/html/Installation_Guide-en-US/s1-rescuemode-boot.html

Sharjeel Aziz

Posted 2010-05-28T13:28:57.957

Reputation: 2 643

I am aware of the single user mode route.. but the is a remote server, and I ave no console/iLO access :-\ – warren – 2010-05-28T15:58:08.253