No root login problem and solution Example


No root login problem and solution Example

In this tutorial we will discuss about some more critical root login related issue. There are several issue those can stop root form login. We will cover all possible issue those can stop root from login in exam.

Step 1 Try to change root password

If you are lucky one then simply changing root password will complete the task. To change password
  • Boot system in single mode
  • run passwd commands
  • change password
  • reboot system
If problem still exist then go on Step2

Step2 Check root account for expire

Examiner can deliver you a root account which is expired. For testing purpose you can also expire it. First login from root and set root account to expire
chage
Now reboot the system. Once system get restarted root will not be able to login. When root will try to login after giving username and password it get an error message (too fast that you hardly be able to read it) and it will put you back on login screen. To resolve this issue boot system in single mode. If you don't know how to boot system in single mode then read our pervious article in which we recovered root password from single mode.
Now boot system insingle mode and check whetherroot account is expired or not
chage
if you see date in account expire line mean root password is expired
set it to never expire fromchage commands and verify thatroot account is set to never expire
chage
Now reboot the system and login from root If problem still exist then go onStep3

Step3 change in /etc/shadow

shadow file contain information about all password store in Linux. Defaultroot password should look like this
entry in shadow
Check this file also fromsingle mode
vi shadow
If you see any! sign in front theroot line as shown in image below then remove! sign Be very careful while making change in this file never remove any character from last of the line or from middle of the line.
editing in shadow
save this file withwq! and check password file
Now open /etc/passwd file
vi password
Entry ofroot account should be look like this
entry of root account
If you seenologin word in the end of line thenremove it
passwd
There should be no! sign in front of the line if any presentremove !sign form the beginning of line.
etc passwd

Share this post

No comments:

Post a Comment