Managing user accounts is a fundamental part of Linux system administration. Whether you’re setting up a new developer account, creating user roles for security, or managing a VPS or dedicated server, knowing how to add and configure users in Debian is essential.
This guide will walk you through the steps to add a new user in Debian, set permissions, and ensure security best practices.
Before adding users, you need administrative privileges. Log in as root or use sudo with your regular account.
Use the adduser command, which is interactive and user-friendly:
You’ll be prompted to:
If the new user needs administrative rights:
This adds the user to the sudo group, giving them permission to run commands as root using sudo.
Switch to the new user account to verify:
Try a sudo command (if you added to sudo group):
You can:
Set user shell:
Set account expiration:
Lock user temporarily:
Use strong passwords.
Avoid giving sudo access unless necessary.
Audit users regularly with:
Use SSH keys instead of passwords for remote login when possible.
On VPS or dedicated hosting (e.g., for web development or managing team access):
Each user can have their own SFTP login
Limited shell access enhances security
Useful for shared hosting environments or web app deployment
Many hosting providers like AlexHost, DigitalOcean, or Hetzner allow this on unmanaged Linux servers.
Adding a new user in Debian is a straightforward task that enhances system management, improves security, and supports multi-user environments. Whether you’re running a personal server or managing multiple users in a hosting setup, following these steps ensures a secure and organized Linux system.