Adding a non-root user to your VPS

Overview

This article explains how to create a non-root user on your VPS after it has been provisioned.

These steps apply to Ubuntu and Debian. Other Linux distributions may use different commands.

Background

When you originally provisioned your VPS, it was created with a root user. Creating a non-root user is useful if you need a separate user who does not have sudo access to the server.

Creating the new user

The following steps create a new non-root user.

In the following example, the new user is named newuser. You can use a different name, but it must follow the rules in the FAQ section below.

  1. Log in to your VPS with either the SSH root password or SSH Key you originally configured. See Configuring and connecting to a VPS for more information.

  2. Run the following command to create a user named newuser.

    [server]$ sudo adduser newuser

    The server prompts you to enter a password for the new user.

  3. Enter a password for the new user, then enter it again to confirm.
    The terminal does not display the characters as you type.

  4. Press Enter to skip each of the remaining prompts for Full Name, Room Number, Work Phone, Home Phone, and Other.

  5. When asked whether the information is correct, press Enter to confirm. This creates the new user.

Test the new user

  1. Log out of your current root user session by typing exit.

  2. Log in using newuser and its password. You can locate the IP address in your panel.

    [local~]$ ssh newuser@your-server-ip
  3. Enter the password when prompted.

  4. Type in whoami and you should see the new username.

    [server]$ whoami
    newuser

FAQs

Does the new user have root access?

No. The adduser command creates a standard user, and the steps in this article do not grant root privileges.

Can I use a name other than newuser?

Yes. You can use any username that follows the server’s default naming rules. In general, a username must start with a lowercase letter and contain only lowercase letters, numbers, hyphens, and underscores, up to 32 characters.

See also

DreamHost links

This form is only for article feedback. If you require assistance, please contact support. Do not include passwords, account numbers, or other private account details.

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?