Ubuntu 16.04 LTS : kich hoat tai khoan root

The root Account in Ubuntu is disabled by default because his password is not set. But if you'd like to use root Account 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.

xerus@dlp:~$ sudo -s 
[sudo] password for xerus: # own password
root@dlp:~# # switched

Or it's possible to switch to root account with su command to set root account's password.

xerus@dlp:~$ sudo passwd root 
[sudo] password for xerus: # own password
Enter new UNIX password: # set root password
Retype new UNIX password: # confirm
passwd: password updated successfully
xerus@dlp:~$ su - 
Password:# input root password
root@dlp:~## switched

* The examples on this site shows as a root account. If you use Sudo, add "sudo" on the head of commands. It had better to limit user if you enable root account. For using by Sudo, it's possible to limit to prohibit shells in sudoers config, refer to details about Sudo Settings. [3] For limit to do su command, set like follows.

root@dlp:~# vi /etc/pam.d/su
# line 15: uncomment and add a group which is allow to do su command
auth   required   pam_wheel.so   group=adm
root@dlp:~# usermod -G adm ubuntu 
  • 2 Người dùng thấy hướng dẫn này hữu ích
Hướng dẫn này có hữu ích?

Những hướng dẫn liên quan

Ubuntu 16.04 LTS : su dung Sudo

Configure Sudo to separate users' duty if some people share privileges. [1] Install Sudo....

Ubuntu 16.04 LTS : tao user

[1]If you'd like to add new user, Add like follows. # add a new user "ubuntu" xerus@dlp:~$ sudo...

Ubuntu 16.04 LTS : cac cau hinh cua lenh Vim

Configure Vim that is more convenience than vi. [1] Configure Vim. ( Apply to a user below. If...

Ubuntu 16.04 LTS : cai dat

[1] Insert a disk for installation of Ubuntu 16.04 and reboot your computer. Next, Choose...

Ubuntu 16.04 LTS : cap nhat he thong

[1] Update System. # Update List first root@dlp:~# aptitude update Hit...