Killing Thunder Dog---Management of users and user groups under Linux no:26 Linux

Source: Internet
Author: User

We first come to the ETC directory with Vim to see the inside of the passwd file. As shown below:

Enter the following as follows:

These are the user's information. After the installation of the operating system, the system will automatically generate some automatic users, the information of these users will be stored directly into the passwd file.

The meaning of the separate representation is as follows:

It is clear to explain what the parameters in the passwd mean.

Above the passwd inside the password display x, in fact, he is stored in the ETC directory under the shadow file, as follows:

Enter the following as follows:

This is a large string of garbled in fact he is the password, but he has been after the Linux encryption function to encrypt him ...

Account information is available, then his group information is also there, he is stored in the ETC directory under the group file, as follows:

After carriage return, the results are as follows:

First column: representing the group name

Second column: representing the group password

Third column: Indicates the group's identification number

Column Fourth: Indicates that the group contains the users

Here actually has the group password and so on, that his storage location is actually in the ETC directory Gshadow, as follows:

Enter the following as follows:

This thing is used very little, know this thing can be.

passwd and group are the only two files that are usually used. They correspond to the Linux users and groups .....

The user's additions and deletions are changed, as shown in the following table:

Useradd: Add a user as follows:

Useradd JJ In this sense is to add a user named JJ, then we go to the passwd directory to see if he exists, as follows:

Enter the following as follows:

In fact, it is obvious that he has already created a successful user.

Above here we are not created to account description information, so he is directly:: So shown, if necessary, then at the time of creation-C, as follows:

Then we'll go to the passwd file in the ETC directory to see the results as follows:

OK, the comment has been added successfully ....

Usermod-l: Modify, modify the time must be added L otherwise it will fail, we will just create the JJ2 modified to Jj3 method is as follows:

So he's a success, and then we go inside passwd and look underneath, as shown below:

has been modified successfully, but his login directory is not changed any ...

Usermod-l User name: This allows a user to be locked out so that he cannot use it. As shown below:

Usermod-u User name: This allows the user to be unlocked as follows:

passwd User name: Set a password for the user:

Then log in to see:

Discovery can be successfully logged in, then we will first exit him, as follows:

Then use the root user to give him the Usermod-l user name: Lock her as follows:

And then re-login with the JJ3 user

This will reveal that he has failed the login, and then we use the root account to unlock her with the usermod-u username as follows:

Then log in again under JJ3 user, so that he can be found successfully logged in, as follows:

Userdel User name: Delete the user as follows:

So he can delete the finished ...

Then we check the passwd file in the ETC directory to find out that Jj4 has been successfully killed, I do not like 4 so I will create a 4 and then kill him, brush the program ape so-called control desire?? Hehe, the effect is as follows:

Successful I pressed off, no jj4, only Jj3,, although killed Jj4, but Jj4 directory is still stored in the home directory, as follows:

This is actually good solution, we add a-r parameter before removing the user, the problem can be solved. We have a JJ user on our server, so let's start with him, as shown below:

The success of the perfect kill ...

Group:

Group is in fact the simplest, adding and removing changes and users are almost, the user is the USERXXX group is groupxxx ...

Groupadd Group name: Create a group as follows:

GROUPMOD-N Group Name: (Where-n is the name of the modified group) modifies a group name, as shown in the following example:

Then we go to the ETC directory to see the group to find the group name has just been modified, as follows:

You can see it after you enter it, as shown below:

Groupdel: This removes a group as follows:

When deleting a user account, be sure to note that deleting a user account does not necessarily delete the group.

USERADD-G Group name User name: Create a user and put the user's information in a group, as follows:

This problem can be solved ...

Kill Lei Dogs---Management of users and user groups under Linux no:26 Linux

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.