Switching from user to user root user

(1) from the user to switch the user to root

Whether Login Ubuntu, or log in command line mode graphics mode, we will find the default user is the user

But when we need to do something (such as a file system repair also) have root privileges, often need to use sudo authorization, I feel a lot of trouble

At this point we can switch to the root user, simply executing sudo su  to

Note: For security reasons, there is no fixed root user password Ubuntu's default, which password is randomly generated and dynamically change

, It looks like a change every five minutes, so use su (switch user) is not possible, because we do not know the root password

 

(2) user user switch back from the root user

Want to cut back from the root user user user simply execute the command: su user  (user installation time is your own user name), or enter exit, also launched key combination Ctrl + D

 

(3) setting a password to the root

The default root user password is not fixed, and is locked, if you want to set a root password

Just execute the command: sudo passwd root  and follow the prompts step by step

Such may provide both (1) inside the above mentioned  su root  switch, root password to the root user

Note: After setting the password to the root, you can still  sudo su  to root

Attached: in graphic mode  System -> Administration -> users and groups  can also be provided to the root password

 

(4) disable and enable root login

Execute  sudo passwd -l root  can (just disable the root, but the root password is still preserved), and then execute su root discovery authentication fails,

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

 

(5) make Ubuntu auto-login

Graphics mode  System -> Administration -> Login Window  after authorization unlock selection

As a user can be automatically logged.


Vb enhancement on installing problems:

APT-GET install gcc sudo
sudo APT-GET install the make
sudo APT-GET install Linux-headers - $ (uname -r)
if not enough, coupled with a sudo apt-get install build-essential and then reboot it.

Guess you like

Origin blog.csdn.net/showmessage0804/article/details/8438764