User Administration

From SlackWiki
Revision as of 23:36, 6 June 2009 by Erik (talk | contribs) (Copy from old)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to 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