Useradd[options] USERNAME
- u UID Specify user ID , greater than -
- G GID ( Basic Group ), group must exist
- G GID , ...,... ( Additional group, can have multiple )
- C "COMMENT" Comment Information
- D /path/to/somedirectory Specify home directory
-s/bin/bash specify shell path SHELL environment variable ECHO $ SHELL
-m-k ( file copy in/etc/skel/to the home directory created ) force a home directory for users
ls-a/etc/skel/ Show hidden files
- M do not create home directory /etc/login.defs
- R system users, can not log on to the system, no home directory. 1-400
Environment variables:
PATH
SHELL
Histsize
Userdel: Delete User
Userdel[option] USERNAME , if you do not specify any options, the user's home directory will not be deleted '
- R: Delete a user's home directory while deleting it
ID : View the user's account attribute information.
-U user
-G Group
- G Additional groups
- N Display Name
Fingerusername need to install
the function of the Linuxfinger command is to query the user's information, typically displaying the user name, home directory, stasis time, logon time, logon Shell and other information. If you want to query the user information on the remote computer, you need to follow the user name "@ hostname", the [username @ hostname] format, but to query the network host needs to run the finger daemon.
Modify user account attribute information option with the Useradd similar
usermod [Options] USERNAME
- u Modify User ID
- G Pre-existing groups when needed
- G previous additional groups will be overwritten. -a-g Append additional group, do not overwrite.
-C
-d-m Move the previous file to the new home directory.
-S
- L Modify LoginName
- L lock Account, disable
- u Unlock account
Chsh : Modify the user's default Shell
CHFN : Modify User's comment information
Password Management: passwd [USERNAME] administrators can modify other users ' information
--stdin: read password from standard input
Echo "Redhat" |passwd--stdin user3 Piping Create user account in script, set password
-L Lock
-U unlock
-D Delete Tail/etc/shadow
Pam
Pwck Check the integrity of user accounts
chage Modify user Password expiry time Manchage
Group Management:
Groupadd
-G GID
- R Add a system group group-r Apache Tail-1/etc/group
Groupmod
-G GID
- u Group name
Groupdelusername
gpasswd USERNAME add a password to a group
The owner of the user-created object is the basic group that the user belongs to touch ahead
Newgrp Switch to the new base group and need to log in to exit with a password
This article is from the "7489131" blog, please be sure to keep this source http://7499131.blog.51cto.com/7489131/1703871
How to use User management and group management commands for Linux users