Sunday, July 20, 2008

Enable and Disable "root" on Ubuntu Linux

On Ubuntu Linux, the "root" account is disabled by default. Normal users can use "sudo " to when he has to run a programe as root. This provides a bit more safety but sometimes typing "sudo" is dirty work. On other Linux distributions, you can use "su" to switch into root account. You can enable the function on Ubuntu.

Set the root's password:
sudo passwd root

Enter the password twice. Now you can use "su" to enter root account.

But how to disable root's account? The answer is "passwd". In your normal account, type "sudo passwd -l root". Here, the argument "-l" means "lock". It locks the root account. However, you can unlock the root account by typing "sudo passwd -u root" if you have set the root's password. Here, the "-u" means "unlock".

No comments: