Reading Time: < 1 minute
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
II. How to Remove (Delete) a User on Fedora 23
Pre-Flight Check
- These instructions are intended specifically for removing a user on Fedora 23. The process on most other Linux operating systems is identical.
- For this tutorial, we’ll be using a Liquid Web Self Managed Fedora 23 server, logged in as root.
Step #1: Delete the User
In this case, we’re removing the user we added in How To Add a User and Grant Root Privileges on Fedora 23, newuser:
userdel newuser
If you want to remove the user and all of the user’s files as well, you can include the “-r” flag:
userdel -r newuser
Note: Before removing a user’s files, please be certain that they won’t be needed again, as the files will not be recoverable. If in doubt, first back up the files by moving them to another location or downloading them locally first.
Step 2: Remove the User’s Root Privileges
Run the command:
visudo
And find the following code:
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
newuser ALL=(ALL) ALL
In this case, we’re removing root privileges from the user “newuser”, so remove the following line:
newuser ALL=(ALL) ALL
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.
Related Articles:
About the Author: dpepper
Categories
Have Some Questions?
Our Sales and Support teams are available 24 hours by phone or e-mail to assist.
1.800.580.4985
1.517.322.0434
Latest Articles
How to Use React Spring
Read ArticleAccessing Man Pages on Ubuntu 16.04 LTS
Read ArticleTLS vs SSL: A Comparison
Read ArticlePremium Business Email Pricing FAQ
Read ArticleMicrosoft Exchange Server Security Update
Read ArticleWant More Great Content Sent to Your Inbox?