Linux switch between each user and the root user ordinary

Just switch as root, the environment is still a normal user shell

his, its - its root

Follow the prompts to enter the root password, you can log in to the root authority.

User and the environment have been switched to root shell

sudo -i sudo su, sudo su root

Follow the prompts to enter the root password, you can log in to the root authority

(The three commands, generally do not need to enter the appropriate root password) .

root switch to common user

Users want to switch back to user root from a user simply execute the command: su username

Disable and enable root login

Sudo passwd -l root to perform (just disable the root, but the root password is still preserved), and then execute su root discovery authentication fails (but still have access to sudo su command under root mode).

To start the root login again, you can execute sudo passwd -u root.

Guess you like

Origin www.cnblogs.com/tongyishu/p/11985565.html