Managing users is a critical part of server administration. Creating separate accounts improves security, allows role-based access, and makes it easier to manage multiple users. This guide explains how to create and manage users on Debian servers.
sudo adduser username
This command creates a new user and prompts you to set a password and optional details.
sudo usermod -aG sudo username
This adds the user to the sudo group, allowing them to run administrative commands.
su - username
This switches the current session to the new user.
sudo deluser username
To remove a user and their home directory:
sudo deluser --remove-home username
cut -d: -f1 /etc/passwd
This displays all user accounts on the system.
Create a new group:
sudo addgroup developers
Add a user to a group:
sudo usermod -aG developers username
Note: HostPalace Debian servers come pre-configured with secure defaults, but creating and managing users is recommended for multi-user environments.