How to get root privileges in UBUNTU

In the terminal enter: sudo passwd root

​Enter new UNIX password: (enter your password here)

Retype new UNIX password: (make sure you enter the password)

passwd: password updated successfully

Later, if you want to gain root privileges, just do the following:

su rootPassword : (enter the password you set above here)

If you want to disable the root account again,

Then you can execute  sudo passwd -l root

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326770412&siteId=291194637