[opensuse] Forgot root password
Hi, How can i recover my root password or create a new one. I coosed a complicated one and forgot it. Thank you -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, 2011-06-27 at 10:40 -0400, Adam Tong wrote:
Hi,
How can i recover my root password or create a new one. I coosed a complicated one and forgot it.
Assuming you have access to the console, and your grub is not secured (so no password in grub), you can pass init=/bin/sh as command on the boot line. This will get you right into a shell without any services. Modify /etc/passwd and /etc/shadow accordingly and you should have a new pass in no time. Alternatively, of course, you can boot off a life cd, mount your root partition and modify those files. Dominique -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wed, 29 Jun 2011 00:26:08 +0530, Dimstar / Dominique Leuenberger
Assuming you have access to the console, and your grub is not secured (so no password in grub), you can pass init=/bin/sh as command on the boot line. This will get you right into a shell without any services. Modify /etc/passwd and /etc/shadow accordingly and you should have a new pass in no time.
when i did that recently on a debian installation, the / filesystem was mounted read-only. i had to remount it with the following command (as root): mount -o remount,rw / haven't forgotten or messed up my openSUSE pwd. yet, but think it's the same. more info: http://en.opensuse.org/SDB:Recover_root_password -- phani. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 06/27/2011 09:40 AM, Adam Tong wrote:
Hi,
How can i recover my root password or create a new one. I coosed a complicated one and forgot it.
Thank you
Like Dominique said. Here is just a little more detail: For both grub and lilo: 1. Boot the system and select the normal boot menu from the list. Once selected, in the “Boot Options” box type “init=/bin/bash” if you are using GRUB Boot loader “linux init=/bin/bash” if you are using LILO Boot Loader 2. Once you have finished booting make sure '/' is mounted in read/write mode (e.g.): 14:42 alchemy:~> mount devtmpfs on /dev type devtmpfs (rw,relatime,size=1923096k,nr_inodes=480774,mode=755) tmpfs on /dev/shm type tmpfs (rw,relatime) devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000) /dev/sda6 on / type ext3 (rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered) <snip> (see the '(rw,...) above after /dev/sda6 on / type ext3 ) If it is not mounted in 'rw', then you will need to remount '/' in read/write mode with: mount -o remount,rw / 3. Then just simply change the password as normal: 14:42 alchemy:~> passwd Changing password for root New Password: Reenter New Password: Password changed 4. Done -- reboot -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
*Original sent by / Original von / Oorspronklik van:* adam.tongu@gmail.com - Mon, 27 Jun 2011 10:40:35 -0400
Hi,
How can i recover my root password or create a new one. I coosed a complicated one and forgot it.
Thank you *This Reply from / Antwort von / Antwoord van:* LLLActive@GMX.Net - 2011-06-30 - 12:04:46 -0400
I used to be able to delete the password in the /etc/passwd file, and reboot without a password. Then I could set a new password. You had to get to the machine and boot by CD in a recovery mode, hang on the root FS of the wanted system and change the password entry for root. Later this method was blocked with the shadow file. I'm not sure when that was, but I know of no other method to do that any more. It will also interest me how to do it now. :-) Al -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
LLLActive@GMX.Net said the following on 06/30/2011 06:32 AM:
I used to be able to delete the password in the /etc/passwd file, and reboot without a password. Then I could set a new password. You had to get to the machine and boot by CD in a recovery mode, hang on the root FS of the wanted system and change the password entry for root. Later this method was blocked with the shadow file. I'm not sure when that was, but I know of no other method to do that any more. It will also interest me how to do it now.
<irony> Its a shame there isn't a "-r FSroot" for "passwd" so that you can boot off the liveCD, mount the hard disks rootFS at /mnt/disk and then passwd -r /mnt/disk --stdin root </irony> Al, how about editing the shadow file? Use 'man shadow' to find out what field to edit. -- The spirit of resistance to government is so valuable on certain occasions that I wish it to be always kept alive. It will often be exercised when wrong, but better so than not to be exercised at all. --Thomas Jefferson -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 6/30/11 12:42 PM, Anton Aylward wrote:
LLLActive@GMX.Net said the following on 06/30/2011 06:32 AM:
I used to be able to delete the password in the /etc/passwd file, and reboot without a password. Then I could set a new password. You had to get to the machine and boot by CD in a recovery mode, hang on the root FS of the wanted system and change the password entry for root. Later this method was blocked with the shadow file. I'm not sure when that was, but I know of no other method to do that any more. It will also interest me how to do it now. <irony> Its a shame there isn't a "-r FSroot" for "passwd" so that you can boot off the liveCD, mount the hard disks rootFS at /mnt/disk and then
passwd -r /mnt/disk --stdin root </irony>
Al, how about editing the shadow file? Use 'man shadow' to find out what field to edit.
I am sure I tried that just after the change, and could not get it to work by changing both files. I have not done it lately, but good to know it works again by editing the files. :-) Al -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
LLLActive@GMX.Net said the following on 06/30/2011 06:55 AM:
Al, how about editing the shadow file? Use 'man shadow' to find out what field to edit.
I am sure I tried that just after the change, and could not get it to work by changing both files. I have not done it lately, but good to know it works again by editing the files.
If I recall the 'change' to shadow passwords was along time ago. I recall using them in SVR4 at the beginning of the 90s You don't need to edit _both_ files, just the shadow file. And it needs to stay chmod 0640 and chown root:shadow In fact if you blank out the 'password' field of the /etc/passwd file you will break things! That needs to be an 'x' to 'point' to the shadow file. -- Undoubtedly a man is to labor to better his condition, but first to better himself. - William Ellery Channing -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (6)
-
Adam Tong
-
Anton Aylward
-
David C. Rankin
-
Dimstar / Dominique Leuenberger
-
LLLActive@GMX.Net
-
phanisvara das