Common Linux commands (related to users)-General Linux technology-Linux technology and application information. For details, refer to the following section. Passwd command
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
#
Su command
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.
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