LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Password Recovery in Linux (https://www.linuxquestions.org/questions/linux-software-2/password-recovery-in-linux-647117/)

deepak_message 06-05-2008 01:49 AM

Password Recovery in Linux
 
Hi,

Can any one tell me, how to recover user or root password. not change from single mode.

Thanks & Regards,

i92guboj 06-05-2008 01:57 AM

There's no easy way to recover a password unless it's really idiotic. You can google and read about johntheripper, which is a tool that can be used to break passwd files. It's commonly used to ensure that there are no weak passwords on a given system.

You can, however, set a new password for any user if you are logged in as root. If you can't login as root and the single user mode is disabled, boot off a livecd, mount your / partition anywhere, chroot into it and then use the passwd command to set a new root password. Once you have that, you can login as root on your own system and change any user's password with "passwd <username>".

Quag7 06-05-2008 12:29 PM

Quote:

Originally Posted by deepak_message (Post 3175208)
Hi,

Can any one tell me, how to recover user or root password. not change from single mode.

Thanks & Regards,

Passwords are stored on most systems using a one-way hash, so other than brute forcing it (as stated above), there isn't much you can do. This is by design.

lazlow 06-05-2008 12:35 PM

I cannot think of a legitimate scenario where one would need to "break" the password rather than simply replace it. Could you explain why you cannot simply replace the password?

deepak_message 06-06-2008 12:35 AM

Quote:

Could you explain why you cannot simply replace the password?
Actually, This stupid question was asked in the Interview.
See, I know that this is also wrong process. and not a good practice for system administrator.

Thanks, :-)

ciden 06-06-2008 12:52 AM

Quote:

Originally Posted by lazlow (Post 3175750)
I cannot think of a legitimate scenario where one would need to "break" the password rather than simply replace it. Could you explain why you cannot simply replace the password?

If you are an evil hacker and want to steal your friends' girlfriend's fotos from his PC without his knowledge.
This is pretty legitimate.

lazlow 06-06-2008 01:09 AM

ciden

Just boot to a livecd, mount the hd, and steal away.


All times are GMT -5. The time now is 05:41 PM.