Linux Learning Notes (i) switching between root and user in Ubuntu

Source: Internet
Author: User

Ubuntu default is not to start the root user, now describes how to enter the root method.


(1) switch from user to root

Whether you're logging in to Ubuntu in graphical mode or in command-line mode, we'll find the default user

simply execute sudo su to

Note: For security reasons, the default Ubuntu root user does not have a fixed password, its password is randomly generated and dynamically changed

, seems to change every 5 minutes, so using su (switch user) is not possible, because we do not know the root password

(2) User user is cut back from root

To cut back from the root user, simply execute the command:su User (user is the username of your own installation), or enter exit directly, or you can ctrl+d the key combination

(3) Set a password for root

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

Just execute the command:

sudo passwd root (then follow the prompts step-by-step)

Enter the user password:

Enter the root password:

Enter the root password:

This can be referred to in (1) as the su root , enter the root password to switch to the root user

Note: After setting the password for root, sudo su can still switch to the root user

Attached: Users and Groups in the graphical mode system---system management can also set a password for root

(4) Disabling and enabling root login

Execute sudo passwd-l root (just disable root, but the root password is still saved), then perform SU root discovery authentication failed,

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

(5) Allow Ubuntu to log in automatically

Graphics mode, System Management, login window authorization to unlock after the selection

Automatically login as user.


Source: http://www.cnblogs.com/weiweiqiao99/archive/2010/11/10/1873761.html

Linux Learning Notes (i) switching between root and user in Ubuntu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.