Ubuntu 11.04
Sponsored Link

Enable root User2011/04/29

  The root user in Ubuntu is disabled by default because his password is not set. But if you'd like to use root user by some reason, enable it like follows.

[1] Set root password
narwhal@dlp:~$
sudo passwd root

Enter new UNIX password:
# set root password

Retype new UNIX password:
# confirm

passwd: password updated successfully
narwhal@dlp:~$
su -

Password:
# root password

root@dlp:~#
# just switched

* The examples on this site show as a root user from now. If you use sudo, add "sudo" at the head of commands.

[2] If you enable root, limit users to switch to root.
root@dlp:~#
vi /etc/pam.d/su


# line 15: uncomment and add a group that can switch to root

auth   required   pam_wheel.so  
group=adm


root@dlp:~#
vi /etc/group


# line 5: add users you allow to switch to root

adm:x:4:
narwhal

Matched Content