Managing User Accounts
Shell·4 min read·Jan 1, 2025
In Unix-like operating systems, a user represents an individual who can log in to the system, run processes, access files, and perform various tasks based on their permissions.
Each user has a unique username, a unique identifier, and a unique home directory where they can store personal files and configurations.
A brief word on sudo
The sudo command (short for "superuser do") is a command that allows a permitted user to execute a command as the superuser known as "root", which is a special user account with unrestricted access to all files and commands on the system.
As most of the commands presented in this lesson are designed to modify the system's configuration — which is a sensitive operation — they can only be executed with superuser privileges using the sudo command as follows:
$ sudo commandWhere command is the restricted command you want to execute.
When executed, you will be prompted to enter your password, which should grant you the right to run the specified command:
$ sudo commandPassword:Creating users in interactive mode
To add a new user to the system in interactive mode, you can use the adduser command as follows:
$ sudo adduser usernameWhere username is the unique name of the user you want to create.
By default, this command will:
Unlock the CLI & Scripting with Bash module
Learn how to gain advanced control over the OS and automate complex routine tasks prone to manual errors with the CLI and Bash scripting.
You get immediate access to:
- 34 focused lessons across the CLI and Bash
- 4 real-world projects with commented solutions
- Ongoing updates to this bundle
- Lifetime access to this bundle