0
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

muru
  • 197,895
  • 55
  • 485
  • 740
  • @muru I don't think that this question is similar to that you have mentioned. I'm not sure whether @user637289 is familiar with the difference between and administrator, root and standard user but he is tying a wrong method to enter as root. So his confusion was needed to be clarified. – Manish Kumar Bisht Jan 02 '17 at 05:39
  • @ManishKumarBisht you did see that the other user also tried su? And you read bodhi.zazen's answer, which links to the RootSudo article? – muru Jan 02 '17 at 06:04

2 Answers2

1

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:

entering as <code>root</code>

1

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

  • 1
    That's why you should do sudo su - or sudo -i, so that you get a clean root environment – muru Jan 02 '17 at 06:03