## Tutorial ##

Create A New User With Sudo Rights In AlmaLinux

Published on February 28 2023 · Updated on March 01 2023

In this tutorial, we will explain you how to create a new user with sudo rights in AlmaLinux.

Sudo command is one of the most important command. It stands for “super user do!”. Running the sudo command is much better than logging in as the root user.

Any command that has the "sudo" prefix will run with privileged access, or in other words, allow a user with the necessary permissions to execute a command in the role of another user, such as the superuser.

1. Loggin Into The Server

Loggin into your server with Root user access.

ssh [email protected]_ip_address

2. Add User

User following command to add a new user.

adduser [new_user]

Note: Replace [new_user] with your desire username.

Use following command to update the new user's password.

pass [new_user]

Output:

Changing password for user sammy.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
	

3. Add User In The Wheel Group

Use following usermod command to modify new user's group and add the server in the Wheel group.

usermod -aG wheel [new_user]

Note: Replace [new_user] with the newly created username.

4. Test The Access

At this point we have successfully created user and added the user in the Wheel group.

Switch from root user to new user account.

su -  [new_user]

Note: Replace [new_user] with the newly created username.

Let's run update command that root user has privilege to run it.

sudo dnf update -f

When you run sudo command first time in one session, it will ask you to enter user account password. Enter the password to proceed./p>

Output
[sudo] password for [new_user]

If the command runs successfully, the new user has root privilages.

In this tutorial, we have seen how to create a new user with sudo rights in AlmaLinux.

Related Tutorials

Install Fiber Server with Golang on AlmaLinux 9 - HostnExtra

We will show how to install Fiber Server with Golang on AlmaLinux 9. It is a Go web framework built on top of Fast http, the fastest HTTP engine for Go.

How To Install Docker on Ubuntu 22.04 - HostnExtra

We will show how to install Docker on Ubuntu 22.04. Docker Engine is an open source containerization technology. It acts as a client-server application.

How To Install RubyGems on Ubuntu 22.04 - HostnExtra

We will show the steps to install RubyGems on Ubuntu 22.04 using source code.allows you to easily download, install, and use ruby software packages.