- Starting Up the Terminal
- Getting Started
- Building Pipelines
- Running Commands as Superuser
- Finding Help
- Moving around the Filesystem
- Manipulating Files and Folders
- System Information Commands
- Searching and Editing Text Files
- Dealing with Users and Groups
- Getting Help on the Command Line
- Searching for Man Files
- Using Wildcards
- Executing Multiple Commands
- Moving to More Advanced Uses of the Command Line
This chapter is from the book
Dealing with Users and Groups
You can use the following commands to administer users and groups.
addusercommand creates a new user. To create a new user, simply type
sudo adduserloginname. This creates the user’s home directory and default group. It prompts for a user password and then further details about the user.
passwdcommand changes the user’s password. If run by a regular user, it will change his or her password. If run using
sudo, it can change any user’s password. For example,
sudo passwd joechanges Joe’s password.
whocommand tells you who is currently logged into the machine.
addgroupcommand adds a new group. To create a new group, type
delusercommand removes a user from the system. To remove the user’s files and home directory, you need to add the
delgroupcommand removes a group from the system. You cannot remove a group that is the primary group of any users.
chgrpcommand changes group ownership of files and directories.