User Administration

From SlackWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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