You didn't answer my question: Can't you log in as root (after a normal boot)?
There's no need to go into single usermode when you can log in as root.
Originally Posted by unlimit
thanks for the reply but its not working.
It says "no such directory"
What I did -
Edit - kernel - then typed - single or 1 then - b - then - now i am in Single user mode - #- I typed your options - but nothing works- cat /etc/passwd (it says no such directory) - for passwd username - then enter - it shows blank space- then I have to boot it forcefully.
I'm not sure if the above (bold part) is correct. It could be that it is, but just to make sure:
- press a key when grub appears,
- press e to edit (I assume that there is only one entry present, if more are present select the appropriate one),
- select kernel /vmlinuz-2....
- press e to edit
- add single
as last entry,
- press enter,
- press b
- system boots and there should not be any error messages.
You are now in single user mode as root user (no password is asked on RHEL systems) and have a bash shell. From this point on you should be able to use normal commands (like cat or passwd):
If you still cannot access /etc/passwd, what is the output of the following command:
You should see something like this:
-rw-r--r--. 1 root root 1111 Jul 21 10:25 /etc/passwd
-rw-r--r--. 1 root root 1058 Jul 21 10:25 /etc/passwd-
(bold parts may differ).