25th Anniversary Savings | 25% Off Dedicated Servers*Shop Now
25th Anniversary Savings | 25% Off VPS Hosting* †††Shop Now
Limited Inventory: High-Performance AMD-Powered Servers Now Available.* Shop Now >
Dedicated Hosting Deals | From $99/moShop Now

How To Add a User and Grant Root Privileges on Fedora 23

Posted on by dpepper
Reading Time: < 1 minute
Note:
Please note that this article is considered legacy documentation because this OS has reached its end-of-life support.
Users via Command Line 101: Basic User Interaction
I. How to Add a User and Grant Root Privileges on Fedora 23
II. How to Remove (Delete) a User on Fedora 23

Pre-Flight Check

  • These instructions are specifically for adding a user on Fedora 23. The process is identical in most other Linux operating systems.
  • For this tutorial, we’ll be using a Liquid Web Self Managed Fedora 23 server, logged in as root.

Step #1: Add the User

In this case, we’re adding a user called “newuser”:

adduser newuser

Now set the new user’s password:

passwd newuser

After entering the new password, you will need to enter it a second time to confirm.

Step #2: Give the User Root Privileges

We’ll need to edit the sudoers file to add permissions for the new user. To open the file for editing, enter the following command:

visudo

In vim, you can press “a” to enter text insertion mode, and hit the escape key (Esc) on your keyboard to return to command mode. For a refresher on editing files with vim see: New User Tutorial: Overview of the Vim Text Editor.

Find the following code:

## Allow root to run any commands anywhere
root ALL=(ALL) ALL

In this case, we’re granting root privileges to the user “newuser”. Add the following below that code:

newuser ALL=(ALL) ALL

Then type :wq to exit and save the file.

If you’ve followed the instructions correctly, then you now should have a user named newuser who can use sudo to run commands as root!

Should you want to remove (delete) the user, follow the instructions at How To Remove (Delete) a User on Fedora 23.

About the Author: dpepper

Latest Articles

What Is WebP and What Makes it Different from Other Image Formats?

Read Article

Top 10 Password Security Standards

Read Article

Top 10 Password Security Standards

Read Article

How to Install MongoDB on AlmaLinux

Read Article

How to Use the WP Toolkit to Secure and Update WordPress

Read Article