Pacnew Files And User Password

I could not login and I could not sudo. My password is invalidated. Somehow I made a terrible error in editing /etc/password and most probably /etc/shadow and /etc/gshadow. This previous post explains this. I can’t even run grpck to check the sanity of the config files.

I went ahead and reboot. Then pressed the Shift-key to get to the grub menu. Highlight the Advanced setttings for Grub, then pressed Cntrl-e. Find the line headed by the world linux then appended “init=/bin/bash”. Pressed Cntrl-x to reboot. Then I get a bash shell prompt. Then because the kernel is mounted read-only I had to remount it read, write. so,

$ mount -n -o rw /

Then we can set our new passwords, without being prompted the old ones.

$ passwd [Enter]
$ newpassword: ……

This sets the root passwords. Let’s test that first. We reboot.

$ reboot -f

We fix the existing user’s password in the root terminal. I like to login to my root account once in a while. This is a few of those cases.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s