SiliCloud Help Document Center
search
Popular search terms
法律与条款
用户服务
产品
技巧与案例
Node JS
Overview
A sudo user is the type of user with the highest administrative privilege on most Linux-based servers and operating systems. You will need to create a sudo user if you want to get the administrative access with the privilege to change various aspects of the Linux server or operating system. A regular user can’t perform most of the privilege-based access a sudo user has.
Of course, it’s best for you to use the regular user privilege in your day-to-day server maintenance process on Debian OS. This is to prevent any accidental changes on the server settings, which can bring negative effects to the overall server operating system.
Vultr VPS allows you to create a sudo access on your Debian server after you activate it for the first time. Keep in mind that the default access privilege for your Debian server on Vultr VPS will be a root user access. So, by creating a sudo user on your Debian server, you can create a non-root user on the Debian server for a better daily server administration.
This is the guide you can follow to create a sudo user on Debian server, which will apply for Debian version 9 “Stretch”, Debian version 10 “Buster”, and Debian version 11 “Bullseye”.
1. Installing Sudo on Debian Server
You might not find any sudo command installed on the server after installing the Debian server OS on the Vultr VPS platform for the first time. So, it’s important for you to install the sudo command on the server after completing the Debian server OS installation, so you can use it to set up your privileges on the server.
To install sudo on the Debian server, you can use the apt command on the terminal by typing it like this.
# apt install sudo
2. Adding a New User Account on Debian Server
The next step you need to do is to add a new user account using the adduser command. In this step, you will create a new user that you will add to the sudo group later. The new user will have some privileges based on the preferences you have set for it.
It’s important for you to create a strong password for the new user. Keep in mind that you don’t need to fill in the information for all values, so you can keep some values blank or empty. You can use these strings of command on the Debian server terminal to create the new user.
# adduser example_user Adding user `example_user' ... Adding new group `example_user' (1001) ... Adding new user `example_user' (1001) with group `example_user' ... Creating home directory `/home/example_user' ... Copying files from `/etc/skel' ... New password: Retype new password: passwd: password updated successfully Changing the user information for example_user Enter the new value, or press ENTER for the default Full Name []: Example User Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] y
3. Adding the New User to the Sudo Group on Debian Server
After adding the new user on the Debian server, you will need to add the new user to the sudo group. Please note that you can add as many users as you need for your server and add as many users to the sudo group based on your preferences.
To add the new user to the sudo group, you will need to enter the command below on your server terminal.
# adduser example_user sudo
4. Testing the New User on the Sudo Group
Now, it’s time for you to test the new user on the sudo group. You can type this command on the terminal to test the new user on the sudo group you have added earlier.
# su - example_user
The command above will allow you to switch to the new user you have added to the sudo group earlier.
Then, the next step you need to do is to verify the new user you have added by using the whoami command, and then you will need to test the sudo access for the new user using the sudo whoami command. On the terminal, these commands should return you with the root text to signify that the new user has the sudo access and the root privileges.
$ whoami example_user $ sudo whoami [sudo] password for example_user: root
Conclusion
Congratulations! Now, you have a new user ready to use, and you can give the new user the sudo privileges on your Debian server. Keep in mind that it’s best for you to use this new sudo user only for the server administration tasks that require higher access privileges on the server. It is important for you to avoid using root access for the daily maintenance tasks on your server.
Do you have any suggestions for this document?