User and group management in Linux (advanced articles)

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

The last main said some of the common user and group operation command, except those outside and some knowledge to master, the one to share my learning experience

1 see user state

Sometimes, if we want to check the user state you can use the sudo passwd -S user name, although the same command displays the Linux operating system but different results are not the same, taking Ubuntu as an example, if the status is displayed as L said locking, P normal, NP said the password is clear, as shown below:

The 2 locking user

Lock user means so that the user cannot log on, said a method to modify the configuration files, but this method many times is not recommended, because if not careful to somewhere else to change chaos, then serious consequences

Lock the user can also use the passwd -l user name, this also need root permissions, as shown below:

Lock the user, if the user input the correct user name and password can not login is successful, as shown below:


3 to unlock the user

Unlock user order is sudo passwd -u user name, the operation is as follows:

After unlocking can see a user can log in.

4 remove the user login password

For RedHat a user if the password is deleted can log in successfully, but for Ubuntu if the user password was deleted by the user is not logged in, delete the user password is shown as follows

5 user switching

Switch user profile like also used more, order is Su other name, as shown below

6 see single login user information

7 complete the user information

8 add the user to the other group

Linux allows the user to belong to multiple groups, which is beneficial to the operation of some of the authorization, to have a look how the Liming is added to the other group, the command is sudo gpasswd -a user groups, as shown below

This operation is different from the usermod -g group name, shown above in the user operation is also divided into other groups of the original set of invariant, and the usermod -g group name is the user into other group like to leave the original group

With the following command to have a look now Liming belong to several groups

So Liming can switch between the two groups, group newgrp switch command group name, this command needs to sign in to use but do not require the root permission, switch user group to exit should be the first to exit from the current group, to the main group after entering exit

9 related information using ID and the finger command to view the users

ID user name - see cursory information

Finger user name, view detailed information such as phone, email etc.

It should be noted that if the Linux is using Ubuntu, need to use the sudo apt-get install finger installation finger command software

Linux learning is indeed very boring, in addition to command or command, but as long as there is a firm information, there is no problem to learn Linux.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Spike at December 20, 2013 - 2:12 PM