LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I forget my password.what can i do? (https://www.linuxquestions.org/questions/linux-newbie-8/i-forget-my-password-what-can-i-do-4175452161/)

xiaotengyi 02-28-2013 09:47 PM

I forget my password.what can i do?
 
I forget my password to startup

chrism01 02-28-2013 10:00 PM

Can you clarify; do you mean

1. BIOS passwd

2. GRUB passwd

3. root passwd

4. personal acct passwd

xiaotengyi 02-28-2013 10:28 PM

I mean the root passwd,I forget it

bokswager 02-28-2013 10:46 PM

can you provide the operating linux system you're using.

shivaa 02-28-2013 10:46 PM

Quote:

Originally Posted by xiaotengyi (Post 4902090)
I mean the root passwd,I forget it

If you cannot login into the machine, even with your own personal account, then boot your system with CD and reset password by modifying /etc/passwd or /etc/shadow.

Else if you've 'sudo' access with your account, and can login into the machine, then you can reset root passwd by becoming root:
Code:

~$ sudo su - root
~$ passwd root
OR
~$ sudo passwd root

But mentioned your distro i.e. OS.

bloody 02-28-2013 11:04 PM

You could boot from a live-cd, then mount the root partition and chroot into it. Then you can use the "passwd" command to set a new one. Like:

mount /dev/sdXN /mnt/somedir
chroot /mnt/somedir
passwd
exit
umount /mnt/somedir
reboot

xiaotengyi 02-28-2013 11:19 PM

Thanks all.I am using the centos5.4. I have entered the single mode,and change the password.
Thanks all again


All times are GMT -5. The time now is 01:26 AM.