This is a discussion on root password problem within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> Hi, I installed Slack 12.0 but somehow mistyped the root password. I can get in using "linux init=/bin/bash" but ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I installed Slack 12.0 but somehow mistyped the root password. I can get in using "linux init=/bin/bash" but can't find the passwd command. I also went in by booting from CD and using "mount /dev/sda1 /mnt", but changing either /etc/passwd and /etc/shadow doesn't erase the root password either. So, before reinstalling Slack, does someone have another way to reset it? Thanks. |
| |||
| Huub wrote: > Hi, > > I installed Slack 12.0 but somehow mistyped the root password. I can get > in using "linux init=/bin/bash" but can't find the passwd command. I > also went in by booting from CD and using "mount /dev/sda1 /mnt", but > changing either /etc/passwd and /etc/shadow doesn't erase the root > password either. So, before reinstalling Slack, does someone have > another way to reset it? If you boot with init=/bin/bash; you are read only; you have to remount / read-write: mount -o remount rw / passwd and unmount it before rebooting umount / I am not currently in Slackware so I can't tell wher eexactly is the passwd command; but it should not be difficult to find: /usr/bin/passwd; /usr/sbin/passwd; /sbin/passwd or something like. To erase the root passwd by hand (from a bootable CD); find /etc/shadow (not /etc/passwd) and erase the second field of the root entry; you must then have something like: root::13691:0:99999:7::: > > Thanks. |
| |||
| Huub <"v.niekerk at hccnet.nl"> wrote: > I installed Slack 12.0 but somehow mistyped the root password. > I also went in by booting from CD and using "mount /dev/sda1 /mnt", but > changing either /etc/passwd and /etc/shadow doesn't erase the root > password either. You will have to reset the password in /mnt/etc/shadow. Remove all the characthers between the two colons for the password column so the root row looks something like this: root::11690:0::::: regards Henrik -- The address in the header is only to prevent spam. My real address is: hc1(at)poolhem.se Examples of addresses which go to spammers: root@localhost postmaster@localhost |
| |||
| On Sat, 18 Aug 2007 11:09:50 +0200, Huub wrote: > Hi, > > I installed Slack 12.0 but somehow mistyped the root password. I can get > in using "linux init=/bin/bash" but can't find the passwd command. I > also went in by booting from CD and using "mount /dev/sda1 /mnt", but > changing either /etc/passwd and /etc/shadow doesn't erase the root > password either. So, before reinstalling Slack, does someone have > another way to reset it? The two methods are good, also can use at boot prompt one of the variations on 'linux single' 'linux rescue', the /bin/bash is much faster :-) I think you forgot to chroot the "real" / or to mount it readwrite ? mount -o remount,rw / or: mount -o remount,rw /dev/yourslashdotpartition |
| |||
| > The two methods are good, also can use at boot prompt one > of the variations on 'linux single' 'linux rescue', the > /bin/bash is much faster :-) > > I think you forgot to chroot the "real" / or to mount it readwrite ? > > mount -o remount,rw / > > or: > > mount -o remount,rw /dev/yourslashdotpartition > I must have forgotten to install some packages, because passwd wasn't there. Editing /etc/shadow didn't help either. Reinstalling from scratch now. Thanks for helping. |
| |||
| On Sat, 18 Aug 2007 15:12:59 +0200, Huub wrote: >> The two methods are good, also can use at boot prompt one of the >> variations on 'linux single' 'linux rescue', the /bin/bash is much >> faster :-) >> >> I think you forgot to chroot the "real" / or to mount it readwrite ? >> >> mount -o remount,rw / >> >> or: >> >> mount -o remount,rw /dev/yourslashdotpartition >> >> > I must have forgotten to install some packages, because passwd wasn't > there. That's very strange indeed, I believe the 'passwd' is in the ..../a/shadow*.tgz package, as it's the one that also provides 'login' you should have had other problems first! More probably some tool or friend or finger was involved in the disparition of 'passwd', might be to investigate :-) > Editing /etc/shadow didn't help either. Reinstalling from scratch > now. Thanks for helping. OK, all's fine now then? Good luck! |
| |||
| Huub <"v.niekerk at hccnet.nl"> wrote: > I installed Slack 12.0 but somehow mistyped the root password. I can get > in using "linux init=/bin/bash" but can't find the passwd command. It is (or should be) /usr/bin/passwd (and it should come with the "shadow" package). > also went in by booting from CD and using "mount /dev/sda1 /mnt", but > changing either /etc/passwd and /etc/shadow doesn't erase the root Of course, with your hard disk mounted at "/mnt" the shadow file is at "/mnt/etc/shadow", the one YOU erased is the one in the RAM-disk, installed by the CD-rom boot system. Just emptying the password field for "root" in that file (/mnt/etc/shadow, it should be the 2nd field, between the first and second : character) should wipe out the password for root. -- ************************************************** ****************** ** Eef Hartman, Delft University of Technology, dept. EWI/TW ** ** e-mail: E.J.M.Hartman@math.tudelft.nl, fax: +31-15-278 7295 ** ** snail-mail: P.O. Box 5031, 2600 GA Delft, The Netherlands ** ************************************************** ****************** |
| |||
| > It is (or should be) /usr/bin/passwd (and it should come with the > "shadow" package). That was the odd thing: /usr/bin wasn't there... > Of course, with your hard disk mounted at "/mnt" the shadow file is > at "/mnt/etc/shadow", the one YOU erased is the one in the RAM-disk, > installed by the CD-rom boot system. > Just emptying the password field for "root" in that file > (/mnt/etc/shadow, it should be the 2nd field, between the first and > second : character) should wipe out the password for root. Ok,...got it now. BTW, had to even repartition since I got "no space left on device". Booting smoothly now...root and user set ok. |
| |||
| Huub <"v.niekerk at hccnet.nl"> wrote: >> It is (or should be) /usr/bin/passwd (and it should come with the >> "shadow" package). > > That was the odd thing: /usr/bin wasn't there... Maybe /usr is a separate mounted filesystem in your PC? Then, of course, it doesn't get mounted with your mount of the hard disk at /mnt (and even when it is not, WITH the harddisk mounted onto a ram-disk system, the command is /mnt/usr/bin/passwd). When you boot with a "root=" option, the _real Harddisk_ should be mounted in its normale place (as /), so THEN it is /usr/bin/passwd again. -- ************************************************** ****************** ** Eef Hartman, Delft University of Technology, dept. EWI/TW ** ** e-mail: E.J.M.Hartman@math.tudelft.nl, fax: +31-15-278 7295 ** ** snail-mail: P.O. Box 5031, 2600 GA Delft, The Netherlands ** ************************************************** ****************** |
| ||||
| Eef Hartman wrote: > When you boot with a "root=" option, the _real Harddisk_ should be > mounted in its normale place (as /), so THEN it is /usr/bin/passwd > again. But THEN the _real /etc/shadow_ would be used to verify the password during logon. And Huub started this thread because he mistyped the root password during installation and he is denied root access in the normal way. Regards, Kees. -- Kees Theunissen. |
| Thread Tools | |
| Display Modes | |
|
|