• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How To Create An Almost Root Equivalent Users But Not Root Identical User in Linux

by admin

Question: How can we have extra root users, because from security point of view we should keep the root user safe from daily accessing and use another “AS ROOT” user otherwise if root is blocked for any reason we may can’t access the server.

Need to create an almost root equivalent users but not root identical user. How to achieve this?

It is recommend to create new user and provide root privileges to that user so that the user can run administrative task using sudo. Follow the following steps:

1. Add the user:

# useradd -u -g -m -d /home/ -s /bin/ username

2. Take a back up of the file /etc/sudoers:

# cp -pv /etc/sudoers /etc/sudoers.bak

3. Edit the file using visuo command:

# visudo

4. In the file the changes to be made are as follows:

## Allow root to run any commands anywhere
root ALL=(ALL) ALL
username ALL=(ALL) NOPASSWD:ALL      ### add this line
UNIX / Linux : How to delete root equivalent user (Non-Root User with UID 0)

Filed Under: Linux

Some more articles you might also be interested in …

  1. The Squid Service in Failed State with Error: “Failed to make swap directory /var/spool/squid/00: (13) Permission denied”
  2. How to backup Linux OS using “dd” Command
  3. mkfs.ext4 Command Examples in Linux
  4. Sample /etc/multipath.conf file
  5. How To Configure sssd To Work With Multiple Active Directory Domains in Different Forests (CentOS/RHEL)
  6. “su: Authentication failure” – in Docker
  7. pvdisplay Command Examples in Linux
  8. How To Check Swap Usage of Each Processes in Linux
  9. CentOS / RHEL : How to get the date and time of executed command in the history command output
  10. ifconfig Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright