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 belowsudo passwd -l root
( or )
sudo usermod -p '!' root
No comments:
Post a Comment