Question: I’m unable to do su – on Ubuntu. It says “su: Authentication failure”. How do I fix it? Also, is it possible for me to login to Ubuntu using root account directly?
Answer: Let us address these two question one by one.
Warning: Enabling root is not recommended. If possible, you should always try to perform all administrative tasks using sudo.
Question 1: I’m unable to login using su command. How to fix this?
By default, root account password is locked in Ubuntu. So, when you do su -, you’ll get Authentication failure error message as shown below.
$ su - Password: su: Authentication failure
Enable super user account password on Ubuntu
First, set a password for root user as shown below.
$ sudo passwd root [sudo] password for ramesh: Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
Now with the new password you can login as super user with su command
$ su - Password: #
Disable super user account password on Ubuntu
Later if you don’t want to use su anymore, you can lock the root user password using one of the methods shown below
$ sudo passwd -l root
( or )
$ sudo usermod -p '!' root
Question 2: How do I login to Ubuntu directly using root account?
First, you should allow the root user to be logged in from the X as explained below.
Step 1: Go to System -> Administration -> Login window.
Step 2: In the Security tab, click on the check box “Allow local system administrator” as shown below. After this change, reboot the system and login directly using root account.
Comments on this entry are closed.
I think you blew this one. Though the analysis of why they couldn’t “su -” directly was right on, the answer is to run “sudo su -” to gain root.
Normally you only need root access once in awhile. To execute a single command with root privileges, just use sudo in front of the command, such as:
sudo gedit somefileyounormallycouldnotaccess
If you will be doing several commands in a row that need root access, use:
sudo su
In either case, you will be asked to enter your password before proceeding. That’s all you need. No need to change root password, just use your own.
> To execute a single command with root privileges,
> just use sudo in front of the command, such as:
> sudo gedit somefileyounormallycouldnotaccess
And if you need to execute multiple commands simply execute “sudo -s” and enter you own user password. Then you get a root prompt. Nearly the same as using su.
it’s saver not to enable root account.
When you need it do :
sudo su –
Any thoughts about ‘sudo bash’ ? I use that quite often actually..
@C Baltimore,
Ofcourse. We have to use sudo to execute any root commands in Ubuntu. I did mention this in the article under “Warning” section. I’ve moved the warning section to the top of the article, to make it visible.
The purpose of this article is only as a FYI for those who come from other Linux distro (for e.g. Red Hat), where they typically do ‘su – ‘ to gain root. If they still want to continue doing ‘su – ‘ on Ubuntu without doing ‘sudo su -‘, they can use the method mentioned here. (which is still not recommended as I’ve mentioned in the warning section).
Thanks Ramesh, I was stuck in the same issue and it helped me.
guys, how do I ocnnect to the internet? I replaced my windows XP with Ubuntu 9.10 and now I get a message in the terminal saying oli ‘dip’ group members are allowed to use this command when I use “pon dsl-provider” to connect to the web.
Man, you saved my day!
Hi
Same problem I got today. Log in screen shows “Authentication failure” after trying to change in “log in window preference”.
I am new in UBUNTU. I could not follow you as stated above as $ sudo passwd root and others. I want to log in as before. Please help me out.
Thanks
Ramesh made it clear that it is not good security policy to enable root. If your intent is to add your quacking voice to the cacophony just to hear yourself, bravo! But the user would have discovered how to enable root with or without Ramesh’s help – and, on his own, would likely have not also discovered that there is great risk in doing so.
Oh, but you’re all the experts. Sometimes the personality of the linux community sickens me; like sharks after one of their own…
(And save your admonitions for me: I’m betting I’ve been wrangling linux distros longer than most of you have been alive.)
hi sir, i want ubuntu more information how to learn in ubtunu ple help me sir
I installed Ubuntu using VMWare on my Windows XP PC.But I was able to login to my account only once after 3-4 attempts.I get authentication Failure error now.I am new to Linux/Ubuntu;please support.
Hi got a quick solution from the website.Went to recovery mode after pressing Shift on boot up,dropped to root shell prompt and changed the password for the relevant user.
Ramesh
Thank you very much for the information. it was helpful to know about root account access.
Regards
Vijay
I have deleted my user account from guest by mistake………
now i am unable to add user account it is showing Addroot password………
if i am using above method $ sudo passwd root
“unable to chande to sudors gid : operation not permitted”
this error is coming ………..
please help
thnank you very much, i was getting this problem “Authentication failure”,, now its ok by your solution,,,keep it,,
I’m unable to do su – on Ubuntu. It says “su: Authentication failure”. How do I fix it?
thank you…it does work…
Thank you. It works and you save my day.
Hi Guys,
You can use the below command too..
sudo su
hai, ! thanks a lot 🙂
thank u friends
Thanks a lot
this really help me..thanks alot:-D
thanks for this
how do you allow root logon from version 12 of ubuntu?
Thanks a lot boss
Thanks Ramesh. It was helpful.
I know this is old as earth however, to disable the account one must use the -L and not -l (capital and not small letter) with the usermod option.
thanks, worked fine. I wanted to install Java runtime on ubuntu. helped me 🙂
to allow root login in 12.10 and beyond just install gdm and use gdm instead of lightdm
~$ sudo apt-get install gdm after you install gdm you may need to run ~$ sudo dpkg-reconfigure gdm you will first be prompted by a brief introduction where you select you will then be given a choice where you can select on next reboot you can click on “not listed” on the login screen type in root as the user name and then you can use your new password made by following the instructions from Ramesh
to go back to lightdm you can run sudo dpkg-reconfigure lightdm
your information is useful for me to login as root . Thank you so much
This problem was very strange, you gave my life back, thanks so much 🙂
thanks a lot
Thanks alot buddies
thanks its works.
Thanks.
I tried to follow your way…
By the way, regarding the step 1,
Step 1: Go to System -> Administration -> Login window.
Where i can find this?
How can i go to the Login window?
Thanks.
thanks man
hi. I am unable to login using su command ,it says authentication failure . How can I fix it ?
Thanks a lot for the tips!
It really helped
thank you!
“You dont need root, you should use sudo”?
Try running screen as “sudo root” from a user login and then try to list the screens……… The user login owns the X11-process for the your xterm….. It’s not just screen that will fail, there are a bunch of other situations when you get problems.
Also try installing kvm and guests as a user login. It’s possible but it kind of get a bit anoying when you have to type sudo and password for the 436423594362782349 time……
Don’t need the root user- Said no linuxadmin ever……..
Isn’t sudo kind of a security risk? If su requires a root password, which could (should) be different than the user, wouldn’t that be more secure than using the same user password to gain sudo? If someone compromises your system by getting your user pw, root is only a sudo away.
sudo su defeats the purpose of having a secure root. sudo is for the LAZY.
Please tell me how I’m thinking about this wrong. I would honestly like to know.
very helpful info, keep it up
hi
i have Ubuntu 14.04 and i want to install NS2 program
needs install basic package:
**sudo apt-get update
sudo apt-get install build-essential autoconf automake libxmu-dev**
but this message appear :
sudo: unable to change to root gid: Operation not permitted
what i do ??