Whether you are a seasoned developer or a DevOps engineer, setting up a dedicated Ubuntu server is a common task when working with Infrastructure as a Service (IaaS) providers. One of the first things you'll need to do is create a new user and grant them superuser privileges. This guide will walk you through the process seamlessly. Before we proceed, ensure that you have already connected to your remote server via SSH.
Creating a New User
To begin, you will need to create a new user. This process is straightforward:
- Open your terminal.
- Execute the following command:
sudo adduser [user_name]
Replace [user_name]
with your desired username. During this process, the system will prompt you to enter a password and other details such as the full name, room number, and more. Ensure you choose a strong password to maintain server security.
Assigning Superuser Privileges
Once the new user is created, the next step is to grant them superuser privileges. This will allow the user to perform administrative tasks using the sudo
command.
- Run the following command:
sudo usermod -aG sudo [user_name]
Again, replace [user_name]
with the username you set up previously. This command adds the new user to the sudo
group, enabling them to execute commands with elevated privileges.
And that's itβin just a few commands, you have successfully created a new user with superuser privileges on your Ubuntu server. This configuration will empower the user to perform critical tasks while maintaining a secure environment.
Feel free to share your thoughts and experiences. If you want to learn more about similar topics, don't hesitate to check out my other work.
More about the author here.
Cover photo by Tima Miroshnichenko.
Top comments (0)