How To Enable And Disable Root User ( Super User ) in Ubuntu


In Linux (and Unix in general), there is a SuperUser named Root. The Windows equivalent of Root is Administrators group. The SuperUser can do anything and everything, and thus doing daily work as the SuperUser can be dangerous. You could type a command incorrectly and destroy the system. Ideally, you run as a user that has only the privileges needed for the task at hand. In some cases, this is necessarily Root, but most of the time it is a regular user.
By default, the Root account password is locked in Ubuntu. This means that you cannot login as Root directly or use the su command to become the Root user.

Enable super user account password on Ubuntu :

 

First, set a password for root user as shown below.

 sudo passwd root
[sudo] password for user:           [put your user password here]  
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



No comments:

Post a Comment

 
datasoft.ws

Tags

Activator (1) Android (10) App development (1) apps (2) blogger (3) Downloads (5) elastix (1) Games (7) Internet (7) iOS (1) Linux (12) os (7) pbx (1) SEO (1) Social Exchange (1) software development (1) Tips (13) Torrent (1) Trix (2) tutorials (7) ubuntu (8) Voip (1) web development (1) Windows (14)