ubuntu@ubuntu:~$ su -
Password:
su: Authentication failure
I have given the password still it is showing the same as above, can any one help me out
ubuntu@ubuntu:~$ su -
Password:
su: Authentication failure
I have given the password still it is showing the same as above, can any one help me out
su
is used to authenticate as another user (if the account is there on the system; other than yours).
If you want to use su
then you should use:
su username -c command
where username is the name of the account you are trying to use and command is what you want to execute.
It will ask you to enter the password. You will have to enter the password of the username account and not yours.
But since you're simply trying to enter as root
, you should simply type:
sudo su
and enter the password of the root
which is, by default, the password of your administrator account.
Here is a screeshot as an example:
To run the terminal as root,you should access root shell by superuser do sudo
There two ways to do that,
sudo -i
where runs a shell with root privileges,and also acquires the root user's environment.
sudo su
where su
is used to switch to another user, where you can also switch to the root user by invoking the command with no parameter. su
asks you for the password of the user to switch, after typing the password you switched to the user's environment. Saying that sudo su
command means your running su
as sudo
(root). calls bash as interactive non-login shell. So bash only executes .bashrc
. You can see that after switching to root and you will still remain in the same director
sudo su -
or sudo -i
, so that you get a clean root environment
– muru
Jan 02 '17 at 06:03
administrator
,root
andstandard user
but he is tying a wrong method to enter asroot
. So his confusion was needed to be clarified. – Manish Kumar Bisht Jan 02 '17 at 05:39