0845680984
  1. Add User Accounts
  2. Enable root User Account
  3. Network Settings
  4. Service Settings
  5. Update System
  6. Vim Settings
  7. Sudo Settings

The root Account in Ubuntu is disabled by default because his password is not set. To use root priviledges, basically it’s better to use the sudo command with administrative accounts. However, if you’d like to use root Account itself by some reason, it’s possible to use like follows.

[1] The user account added during installation is set an administrative account with Sudo, so it’s easy to get root account’s shell like follows.
sudo -s
[sudo] password for ubuntu:   # input self password
[2] Or it’s possible to switch to root account with standard su command to set root account’s password.
sudo passwd root
[sudo] password for ubuntu:   # input self password
New password:                 # set root password
Retype new password:          # confirm
passwd: password updated successfully

soncq@localhost:~$ su -
Password:                     # input root password
root@localhost:~#             # just switched
[3] For [su] command restriction, set like follows.
 sudo vi /etc/pam.d/su
# line 15 : uncomment and add a group which is allow to run [su] command
auth       required   pam_wheel.so  group=adm

# add an user you allowed to run [su] to the group you set above
usermod -aG adm soncq

Leave a Comment

Your email address will not be published. Required fields are marked *

Bài viết gần đây:

Shopping Cart