Ubuntu: Can we login to the 'root' (Not as root user but in the 'root' user) user in ubuntu?



Question:

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.


Solution:1

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


Solution:2

It is worth to note you can run commands as root by putting a sudo in front of it as well. For example:

sudo chown user:user filename


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »