Settings for existing users can be changed using the usermod command. This command uses the same switches as useradd, plus some additional ones. The additional switches include:
-l new_login_name Specify a new login name for this user. All other settings remain unchanged, and his home directory and files are not affected.
-L Lock the user. He will not be able to log in unless his login is unlocked.
-U Unlock a locked user
The userdel command is used to remove a user from the system. This removes entries from the /etc/passwd, /etc/shadow and /etc/group file relating to this user. He will therefore be unable to log in. If used with the –r switch, userdel will also remove the user’s home directory and mail entries.
The groupadd command is used to add new user groups to the system. If used with the –g switch, you can specify a group ID for this group. Otherwise, it will be allocated the next free group ID
The groupmod command makes changes to groups. Switches available are:
-g Specify a new group ID
-n Specify a new group name.
The passwd command can be used to change passwords or password-related settings. With no arguments or switches, it changes the password of the current user. For users other than root, this is the only option that is allowed. Given a user name as an argument, it changes the password for that user. The following switches can also be used:
-d Set this user to have no password
-S Display the status of this user
-m Set the minimum days before the password can be changed
-x Set the maximum days for which this password is valid
-W Specify a number of days before the password expires when the user will be warned
No comments:
Post a Comment