Hostwinds Tutorials
Search results for:
Table of Contents
Tags: Ubuntu
Executing certain tasks or commands with elevated administrator (root) permissions can be an absolute necessity when managing your own server. However, you may not have access to the root account itself, or you may have that type of access limited on your server for security reasons. This is where the sudo command comes in to save the day! Using Sudo, you can temporarily grant or escalate root/administrator-level privileges to a normal user for a specific task or command. In this article, we will cover how to create a sudo user in Ubuntu.
Before we begin, you'll need to login into your server as the root user via SSH. If you're not certain how to do this, please refer to the following guide: Connecting to Your Server via SSH. Once you're logged into the server via SSH, you can grant a user account sudo privileges by utilizing the following steps.
visudo
root ALL=(ALL:ALL)ALL
root ALL=(ALL:ALL) ALL
new_username_here ALL=(ALL:ALL) ALL
Congratulations, the user should now have sudo privileges! If you'd like to add additional users with sudo privileges, you can add them using the same method referenced above. You can also test to ensure that the user account now has sudo privileges by switching to the user and issuing a command using sudo before the command:
su - username_here
sudo ls -alh /root
If the user has sudo privileges, you'll be prompted for the user's password, followed by a full listing of the root directory after issuing the commands referenced above.
Written by Michael Brower / March 8, 2017