User Administration

From SlackWiki
Jump to: navigation, search

Adding Users

To ADD users: adduser user

Deleting Users

To REMOVE users: userdel baduser

The above command will remove the entry matching the username baduser from the /etc/passwd file and if you're using the Shadow password format (which you should be), also from the /etc/shadow file.

NOTE: The /etc/group file is not modified to avoid removing a group that other users may also belong to. This isn't much of a big deal because you can edit the group file and remove the entry manually.

Should you wish to remove the user's home directory as well, add the -r option to the userdel command. EXAMPLE: userdel -r baduser


Changing User's Passwords

To change users password: passwd user

Adding User to Group

If you want to add your user to other groups in the /etc/group file, you can simply use the gpasswd command like this: gpasswd -a user group