root shell bash commands not working
15,235
mount -o remount,rw /
mount /usr
/usr/bin/passwd root
reboot
where
- you need to mount
/
withrw
to mount/usr
- you need
/usr
forpasswd
command.
Related videos on Youtube
Author by
srinivasu u
Updated on September 18, 2022Comments
-
srinivasu u over 1 year
I attempted to change my sudo password(I removed myself from sudoers list by mistake). I tried following.
- In recovery mode, I dropped down to root shell. It is still asking root password. Ctrl D did not work. I went to generic
e
mode then. I replaced
ro quite splash
withrw init=/bin/bash
and pressed F10 to enter in to root shell.root@nouser$ passwd vasu bash : passwd command not found root@nouser$ sudo passwd vasu bash : sudo command not found
I know commands like sudo and passwd are in
/usr/bin
. But I found/usr
folder to be empty.ls /home
is empty as well . But infact I have three users in home folder. I can executepasswd
command in general boot. (of course, It is telling I can't do that).
Can some one tell me what could be the problem?-
kevy about 9 yearsHave you tried
mount -o remount,rw /
? -
Νίκος Φυτίλης about 9 yearsdid you use mount -a to well mount the tings that are listed in fstab?
-
Νίκος Φυτίλης about 9 years16 sec faster :P
- In recovery mode, I dropped down to root shell. It is still asking root password. Ctrl D did not work. I went to generic