Managing users on a Debian server is essential for controlling access and permissions. This guide explains how to add and delete users in Debian 12.


Step 1: Create an Instance

Before proceeding, ensure you have a Debian 12 instance.

Access the Dashboard: Log in to your Shape.Host account and navigate to the Dashboard.
Click Create: Click the “Create” button at the top-right corner.
Select Instances: Choose “Instances” to start creating a new server.

Shape.host Resources dashboard with Create > Instance highlighted.

Select Location: Choose a data center location closest to your target audience.

Shape.host instance form with the data center location selector highlighted.

Choose a Plan: Select a plan that suits your project, such as Standard, CPU-Optimized, or Memory-Optimized.

Choose an Image: Select Debian 12 as the operating system.

Shape.host instance form with the operating system image selector highlighted.

Authentication and Finalize: Choose your preferred authentication method, either SSH keys or password, then click Create Instance.

Shape.host instance form with the Create Instance button highlighted.
  • Obtain IP Address
  • Once your instance is created, return to the dashboard.
  • Find your instance’s IP address under the Resources section and use it to access your server.
Shape.host Resources dashboard with the server IP address highlighted.

Step 2: Connect to Your Instance

To connect to your Debian server:

  • Linux/macOS: Open a terminal and type: ssh root@<your_server_ip>
  • Windows: Use PuTTY. Enter the server’s IP, select SSH, and log in as root using your credentials.

Step 3: Add a New User

Create a new user named user-1:

adduser user-1  

You will be prompted to set a password and provide optional user information.

Terminal showing Linux user account management commands.

Step 4: Grant Sudo Privileges

Add the new user to the sudo group to grant administrative privileges:

usermod -aG sudo user-1  
Terminal showing Linux user account management commands.

Verify the user in the system:

cat /etc/passwd  
Terminal showing Linux user account management commands.

Step 5: Delete a User

To delete the user user-1 and remove their home directory:

deluser user-1 --remove-home  
Terminal showing Linux user account management commands.

Confirm the deletion by checking the system’s user list:

cat /etc/passwd | grep "user-1"  

If no output appears, the user has been successfully deleted.

Terminal showing Linux user account management commands.

Adding and deleting users in Debian 12 is straightforward and allows you to maintain proper access controls on your server.

For a reliable hosting environment, consider using Shape.Host’s Cloud VPS services, offering high performance and flexibility for your Debian-based projects.