How to Create a Sudo User on Debian

 

 

 

Sudo is a program that runs on Unix-like computer operating systems that enables users to execute programs under the privileges provided by another user, usually the superuser. Sudo refers to either “substitute user do” or “super user do” – either of which allows you to temporarily elevate your user account to have root privileges. This is not the same as “su”, which has a more permanent effect.

 

 

 

 

 

 

Our goal here is to walk you through setting up a sudo user on Debian,

 

 

 

 

 

 

 

Step 1: Configure VPSie cloud server

 

 

  1. Sign in to your system or register a newly created one by logging in to your VPSie account. 
  2. Connect by SSH using the credentials we emailed you.
  3. Once you have logged into your Debian instances and update your system.

 

 

 

Run the command to upgrade your system,

 

 

apt-get update && apt-get upgrade -y

 

 

 

 

 

Step 2: Install sudo

 

 

 

 

Installing Debian Without sudo is possible. In that case, add sudo via apt-get,

 

 

 

apt install sudo

 

 

 

 

 

 

Step 3: Add a New User Account

 

 

 

 

 

Use the adduser command to create a new user account. The user information can be filled in or left blank by pressing ENTER. A user named “testuser” will be created here.

 

 

 

 

adduser testuser

 

 

# adduser testuser
Adding user `testuser' ...
Adding new group `testuser' (1000) ...
Adding new user `testuser' (1000) with group `testuser' ...
Creating home directory `/home/testuser' ...
Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for testuser
Enter the new value, or press ENTER for the default
        Full Name []:
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n] y

 

 

 

 

 

 

 

Step 4: Set up the Sudo Group for the User and test it

 

 

 

 

 

 

Include the new user in the sudo group,

 

adduser testuser sudo

 

 

 

 

 

It’s now time to test, 

 

 

su - testuser

 

#  su - testuser
[email protected]:~$

 

 

 

 

 

That’s all for now, I hope you’ve found this informational

 

 

 






 

Try VPSie for free today!