Tuesday, June 21, 2011

Accounts Management

useradd <options> <username>
-b home dir
-c comment
-e expire date yyyy-mm-dd
-m creates home dir for new user
-r system account
-s shell
-u UID

usermod <options> <username>
-c comment
-d home dir
-g primary group
-G secondary group
-l new login name
-L locks user
-s shell
-u uid
-U unlock user

passwd <options> <username>
-L locks user
-U unlock user
-S status of passwrd

chage <options><username>
-d indicates day password was changed
-E expiration date yyyy-mm-dd
-I change password inactive after password expires before account is locked
-l show aging info
-m min days
-M max days
-W warn days

Note:
account is locked when you see ! character at the start of the password in /etc/shadow

groupadd <group name>
-r creates a system group
-g GID

No comments:

Post a Comment