If you purchased a server or VPS that only gives a root account and you need to create another superuser account, this tutorial will fix your problem. In Linux systems, having another user with superuser or sudo access is important for several reasons:
- System Administration
Having multiple users with superuser privileges allows for distributed system administration. If one user is unavailable, others can still perform critical administrative tasks. - Security
It’s generally not recommended to use the root account (superuser) for everyday tasks due to the risk of making unintended system changes. By having a regular user with sudo privileges, you can execute administrative commands only when necessary, reducing the risk of accidental system damage. - Logging and Accountability
When multiple users have sudo access, it’s easier to track who made which changes to the system. Each user has their own login credentials, so you can better audit actions taken on the system. - Granular Access
You can grant sudo privileges to specific commands or tasks, limiting what a user can do with elevated permissions. This is useful for security and ensuring users only have the necessary level of access for their roles. - Preventing Mistakes
Even experienced administrators can make mistakes. By requiring a user to use sudo and enter their password for administrative tasks, it adds an extra layer of caution and prevents hasty or accidental changes. - Best Practices
Following the principle of least privilege, it’s a security best practice to give users only the permissions they need. If a user only needs occasional administrative access, it’s better to grant sudo privileges than to have them always use the root account.
How to Create A New SuperUser (sudo) Power?
You only need a few step to make a new SSH user. First, I assume you already login to server with current root user. Then run command below:
adduser yourNewUserName
Set Your New User to Have SuperUser (sudo) Power
usermod -aG sudo yourNewUser
Remember, it’s important to choose trustworthy users when granting sudo access, as they will have the ability to make significant changes to the system.
What are your thoughts on this topic? Share this to your social media / friends and give your experiences in the comments below!