Sometime ago I just tested to see if I could login to desktop from root, and I succeeded. I clicked on Others on the userlist and entered root and its password and logged in. Now I'd like to know how we can disable root login altogether. I didn't see any option as such in the Login Screen.
-
If possible, please consider closing some of your other open questions by selecting the best answer (if they have one). Consider which answers have been useful and need an upvote. We need users to maintain their questions so that the site can be an effective tool for the next person with your problems. For more details on best practices consider reading the FAQ on asking questions.– nanofaradAug 22, 2012 at 12:58
4 Answers
On a clean installation of Ubuntu, this should not be possible. This is because Ubuntu by default uses a passwordless root user (i.e. you cannot log in as it directly using normal password-based authentication, such as through the login screen or command-line interface).
However, I suspect that you have changed the password of the root user, in which case I highly recommend that you make it passwordless again (which would disable all forms for password-based login):
sudo usermod -p '!' root
If you use to log in as the root user to do adminastrive tasks, I would urge you to use sudo
instead to gain elevated priviliges as a normal user (in the admin group).
Resources:
sudo(8)
manpage for Ubuntu 10.10 Maverick Meerkat- Root/Sudo page in the Community Ubuntu Documentation
Issue the following command in terminal to disable root account,
sudo usermod -p '!' root
Look at the following link to get more information,
To disable the root login (lock the account) open the Terminal and execute:
sudo passwd -l root
You will be prompted for an administrators password (not the root password).
The letters of the password will not appear while you type it.
@Karthick87,
-p = 'use encrypted password for the new password'
Can you explain please how this would stop root from logging in via GDM?
@Pawan: Follow the steps:
System -> Administration -> Login Screen Setup
Go to the "Security" tab.
Under Options:
Allow root to login with GDM (Checked)
Please let me know if this is the solution!