-G | Supplementary group membership | |
-M | Don't create a home directory | |
-m | Create a home directory if it doesn't exist | This is the default action. |
-p | Set encrypted password to | Useful when copying accounts from an old system configuration. |
-s | Sets the user's shell to | |
-u | Set the numeric user ID to | Useful when copying accounts from an old system configuration or synchronizing with old NFS servers. |
-L | Lock account against login | |
-U | Unlock account and permit login |
To set Jane's full name when her account is created, execute:
# useradd -c '
# usermod -c '
As you'd expect, the
# userdel
The
To add a group, just specify the name as an argument to
# groupadd
The only option commonly used is -g , which lets you manually select the group ID (useful if converting data from an old system):
# groupadd -g
The
# groupmod
# groupmod -n
To delete a group, use
# groupdel
4.7.1.4. Managing user passwords from the command line
$ passwd
Changing password for user chris.
Changing password for chris
(current) UNIX password:
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
When used by the
# passwd