Account and rights management-related commands

A user account
1.useradd command - increasing user account
command format
useradd [option] username

Common options
-u: specifies the user's UID number, UID number is not required to change other users
-d: specifies the location of the user's home directory
-e specified user account expiry time may be used YYYY-MM-DD date format
-s : Specifies the user's login Shell

Example 1: New demo account specified expiration date of the account and can not login
Account and rights management-related commands

passwd command - set / change user password

Examples of demo password
Account and rights management-related commands

passwd-- account set
parameters
-d to clear the specified user password
-l locking account
-S view the user account status
-u unlock user accounts

Examples of locking accounts demo
Account and rights management-related commands

usermod command - modify user account attribute
parameter
-u modify the user's UID number
-d modify the host directory location
-e modify user account expiration time
-s Specifies the user's login Shell
the -l Change the user account login name
-L Lock user accounts
-U unlock account

Examples: lock the account and unlock accounts
Account and rights management-related commands
instance two demo account name to demo1
Account and rights management-related commands

userdel-- delete user accounts
-r delete home directory

Account and rights management-related commands

Group account files
and group accounts associated with two profiles:
/ etc / Group deposit account name, GID group members
/ etc / gshadow group account password encryption

account groupadd-- increase group
Example:
Add a group demoA group
Account and rights management-related commands
Account and rights management-related commands

gpasswd-- increased, provided, delete group members
-a plus how the group members
-d delete group members
instance: how is added to the root set of user demo1
Account and rights management-related commands
Account and rights management-related commands
Example 2 will remove from the root demo group
Account and rights management-related commands

groupdel - delete group accounts
Example 3 deleted demoA group
Account and rights management-related commands

Query account information
id-- view the user account identity
Account and rights management-related commands
groups-- query the user login account belongs to the group
Account and rights management-related commands
w command - query the current situation host of user login
Account and rights management-related commands

Guess you like

Origin blog.51cto.com/14449563/2430285