I want to login as user 'root' in bash shell, but do not know the password of it.
Here I am talking about the user which i have found in passwd as below:
sudo cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
So, my basic question is that can we able to login as 'root' user or not?
if yes and some know about it, let me know.
Thank you.
Best Answer
Yes, it is possible. Log in to your administrator account and then run
sudo su root
. Enter your password and then you are logged in as root.(Usually the root prompt looks similar to this:
root@computername:~#
(note the#
instead of the$
))NOTE: be careful when you do that, everything you command is done immediately without asking for a password (just in case you didn't know)
Instead of logging in to the root account you might want to use
sudo
and your command (e.g.sudo apt-get update
).EDIT: "[...] The [root] password is set to a special value which doesn't match any possible key combination." - fkraiem