Root Account Disabled (not smart) Can not root LOGIN
Hello,
I mistakenly disabled the root account in kuser and now can not log in as root. I did this when I repeatedly received an error when trying to log in as su saying that 'could not connect to x'. How can I regain login access with my root password? or have I finally made the BIG error? Mitchell |
you can try to use Slackware CD 1 to boot the system and change the entries in /etc/passwd after you mounted the / (root) partition and chroot to it.
|
Root Account Disabled; Can not root LOGIN
Hello willysr,
I installed slackware 12.2 from iso. Could you please advise step by step how to do the boot and mounting and the change of status on the root account. I am not clear on if I am to unlock the password or to create a new root user account. Thank you. Mitchell |
First try something simple. Log in as normal user, then start Kuser. You'll have to type root's password. If you are lucky and can start Kuser, then clear the 'Account disabled' check box in the root account.
If you are using GRUB as a boot loader, you could try booting into run level 1 (single user mode). Manually add 'init 1' to the boot options. If you can log in at that point, type 'passwd' to change the root password. If you are using Lilo then proceed with Willy's solution. When you boot with the installation CD/DVD, don't run setup. Just log in. Then type: mkdir /hd mount /dev/hda(x) /hd [You have to know the partition number in place of (x)] With the installation CD/DVD you have to use vi as a text editor, so be sure to know the basics of vi (:w, :q, insert, Esc). After mounting the root partition, type: vi /hd/etc/passwd Somewhere in /etc/passwd, usually as the very first line, you should see something like this: root:x:0:0::/root:/bin/bash Notice the colons, which is why you have to understand the colon syntax with vi. You have to be in text insert mode before typing the colons, otherwise vi interprets the colon as a command. Also notice that no password is present in /etc/passwd. That is because the password is stored in /etc/shadow. But you need an entry in /etc/passwd to enable the root account. Restoring that entry might be all you need. If you need to edit /etc/shadow, here is a nice introduction to that file: Understanding /etc/shadow file . You might need to delete the encrypted password before trying to run the passwd command. Yes, there is a passwd command as well as a passwd text file in /etc. :) |
Quote:
|
Root Account Disabled; Can not root LOGIN
Thank you Woodsman and gegechris99.
I am using lilo for Slackware 12.2 and also chainloading Fedora10. This is going to require a lot of new learning. I will begin with the reading and update my progress on this thread. I can not log in to the KUser application. However, interestingly, I can open it as a normal user after running a 'find file'. However, when I try to 'ok' the change of account status (for any account, including root), I receive the error messages - "cannot open file /etc/passwd.bak for writing" and "Can't create back up file for /etc/passwd". Are there any pitfalls (beyond what I have already done) that I should beware of so that I do not have to re-install the entire Slackware again? Mitchell |
Quote:
Then again, perhaps the messages are related only to the fact that you are trying to modify those files as a normal user, who doesn't have permissions to modify those files. Quote:
|
This should be quite easy to fix. Follow Woodsman's instructions to boot with the install disk and mount the Slackware parition. Then edit the /hd/etc/shadow file and look for the entry starting "root:!" it should have the exclamation mark here to mark logins as disabled. Just delete the exclamation and save the file then root should be able to login when you reboot your Slackware.
|
Root Account Disabled; Can not root LOGIN
Hello Woodsman,
I am able to read /etc/passwd, but not /etc/passwd.bak nor /etc/shadow. In /etc/passwd I have 'root:x:0:0::/root:/bin/bash'. It looks like what you posted above. Thank you to all for taking time out to assist me. I will try to follow your directions. I have only gone through the Slackware install process once and am not confident about the directions regarding 'mounting' and then entering the /etc/passwd file to make changes. Once I begin the process, in case of error, I will be left without any means of re-contacting this board (short of starting from scratch) -for further assistance. Mitchell |
Quote:
Do know that when you delete the exclamations mark (there might be two), the root account then will have no password when you boot into Slackware. After logging in as root, run the passwd command to set a new password. |
Quote:
1) Boot to the Slackware install disk. You have to know the partition number in place of (x) for this next step - also the partition may be called sd(x) where (x) is the partition number. If you are unsure of partition names or numbers run "fdisk -l" to show them. Next we mount the Slackware partition on the hard disk to a directory "/hd" in the install directory. 2) Run this: Code:
mkdir /hd Code:
sed -i 's/root\:\!/root\:/' /hd/etc/shadow Here you are using a utility "sed" to search and replace the disabled root login part of the file with a "login enabled" setting. |
Root Account Disabled; Can not root LOGIN - RESOLVED
Hello,
Thank you for the rescue Woodsman, bgeddy, willysr and gegechris99. I booted with the Slackware12.2 iso from dvd. I logged in as root. I did the mkdir /hd mount /dev/hda(x) /hd vi /hd/etc/shadow I removed the '!!' after the root in the entry. I 'esc' ':wq'. I rebooted normally and the system entered run level 4 to login. I logged in as root with my original password and it succeeded. I did not have to do a new password setup. I opened KUser to find that the root account 'Account disabled' toggle is now in the off position. The account is enabled. With community help, this os, Slackware12.2, has been running without need of reloading for longer than any other os I have used. I am very happy that it has been preserved again. Thanks. Mitchell |
Quote:
As us older folks might say: Far out! Out of sight! Groovy! Nifty! :D |
All times are GMT -5. The time now is 01:28 AM. |