Common commands for getting started with Linux-9. Linux User-related commands

Source: Internet
Author: User
Linux User-related commands

PasswdCommand

For the sake of system security, in Linux, each user has a user name and password. Therefore, when you use the useradd command to add a new user, you also need to use the passwd command to set a password for each new user. Later, you can use the passwd command to change your password at any time.

The common format of this command is passwd [user name]. The user name is the user name that needs to change the password. Only super users can use "passwd User Name" to modify passwords of other users. Common users can only use passwd commands without parameters to modify their own passwords.

The command is used as follows:

Input

Passwd <enter>;

Enter the current password under (current) UNIX passwd:

Enter a new password at the prompt (this password is not displayed on the screen ):

The system prompts you to enter the new password again.

After the password is entered correctly, the new password is encrypted and put into the/etc/shdow file. It is important to select a password that is not easily deciphered.

The password selection rules are as follows:

The password should contain at least six (preferably eight) characters;

Passwords should contain uppercase/lowercase letters, punctuation marks, and numbers.

The process for a superuser to modify the password of another user (xxq) is as follows,

# Passwd Root

New UNIX password:

Retype new Unix Password:

Passwd: All authentication tokens updated successfully

#

 

SuCommand

This command is very important. It allows a common user to have the permissions of a Super User or other users, and allows the super user to do something as a normal user. A common user must have a superuser or another user's password when using this command. To exit the identity of the current user, you can exit.

The command is generally in the format of Su [Option] [? ] [User Account]

NOTE: If no user account is specified, the default value is Super User Root. The meanings of the options in this command are as follows:

? C. It will end after executing a command.

? The purpose of adding this minus sign is to make the environment variable the same as the user who wants to convert.

? M retains the environment variables unchanged.

Password: [enter the superuser password]

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.