• 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. DHCP configuration file /etc/dhcp/dhcpd.conf explained
  2. locate: command not found
  3. How to find if NUMA configuration is enabled or disabled?
  4. How To Setup UDEV Rules For RAC OCR And Voting Devices on Partitions
  5. Features of the “Btrfs” Filesystem
  6. Ubuntu: Changing the stripe size of a striped LVM volume
  7. a2dismod: command not found
  8. powerstat: command not found
  9. htpdate Command Examples in Linux
  10. CentOS / RHEL 7 : How to modify Network Interface names

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright