␡
- 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.
-
adduser
: Theadduser
command creates a new user. To create a new user, simply typesudo adduser
loginname. This creates the user’s home directory and default group. It prompts for a user password and then further details about the user. passwd
: Thepasswd
command changes the user’s password. If run by a regular user, it will change his or her password. If run usingsudo
, it can change any user’s password. For example,sudo passwd joe
changes Joe’s password.-
who
: Thewho
command tells you who is currently logged into the machine. -
addgroup
: Theaddgroup
command adds a new group. To create a new group, typesudo addgroup
groupname. -
deluser
: Thedeluser
command removes a user from the system. To remove the user’s files and home directory, you need to add the-remove-home
option. -
delgroup
: Thedelgroup
command removes a group from the system. You cannot remove a group that is the primary group of any users. -
chgrp
: Thechgrp
command changes group ownership of files and directories.