Basic use of Linux-add users-general Linux technology-Linux technology and application information. The following is a detailed description. Let's take a look at the operations to add users. So far, we have used the root user to log on to the system. Because the root user has high permissions and can perform any operation, the system may be damaged sometimes. For example, if you run the "rm-rf/*" command, all files under "/" will be deleted. If we use a common user, we can still execute most of the programs, except for a few administrator commands, some directories, and other operations. Therefore, we recommend that you use a common user when using general operations. If you need to maintain the system, you can use the root user.
Now let's take a look at how to add general users. Follow these steps:
[Root @ Linux one] # useradd user1
We added a user "user1" to the system. After adding a user to z, we need to set a password for the user. See the following operations:
[Root @ Linux one] # passwd user1
Changing password for user user1.
New UNIX password: <-- enter your password here.
Bad password: it is too simplistic/systematic
Retype new UNIX password: <-- enter the above password again
Passwd: all authentication tokens updated successfully. <-- prompt that the password is set successfully.
Note that the password is not displayed for security purposes.
Here we know how to use the "useradd" command to add users and use the "passwd" command to set passwords for users. At this point, we have added a user "user1" to the system. Next time we log on, we can use this user.
Note: Only the root user can set the password of another user. Generally, the user can change his/her password after logon, but cannot change the password of another user. Follow these steps:
[User1 @ Linux ~] $ Passwd root
Passwd: Only root can specify a user name.
The system prompts that only root users can change their passwords. Let's take a look at how users change their passwords:
[User1 @ Linux ~] $ Passwd
Changing password for user user1.
Changing password for user1
(Current) UNIX password: <-- enter the current password
New UNIX password: <-- enter the New password
Bad password: is too simple <-- prompt that the PASSWORD is too simple
New UNIX password: <-- enter a complicated New password
Retype new UNIX password: <-- enter the password entered above again
Passwd: all authentication tokens updated successfully. <-- prompt that the password is changed successfully
In this case, passwd does not need to be followed by the user name.
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