• 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

CentOS / RHEL 6 : How to password-protect single user mode

by admin

Locking down single-user mode in RHEL6 requires editing /boot/grub/grub.conf and /etc/sysconfig/init.

1. Change the definition of the single user login shell in /etc/sysconfig/init from sushell to sulogin

# vi /etc/sysconfig/init
...
# Set to '/sbin/sulogin' to prompt for password on single-user mode
# Set to '/sbin/sushell' otherwise
SINGLE=/sbin/sulogin       <--- changed from sushell to sulogin
...

2. You can also use sed to directly change the required line :

# sed -i "s,^SINGLE=.*,SINGLE=/sbin/sulogin," /etc/sysconfig/init

3. Doing the above results in single-user mode showing the same login prompt normally seen in emergency (maintenance) mode as shown below :

RHEL 6 password protect single user mode

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to send Audit Logs to Remote Rsyslog Server in CentOS/RHEL 6,7
  2. sysctl setting for high load and prevent DDoS
  3. What are SELinux Users and how to Map Linux Users to SELinux Users
  4. Linux OS Service ‘irqbalance’
  5. CentOS / RHEL 5, 6 : how to disable NetworkManager
  6. mkswap Command Examples in Linux
  7. how to add a custom script to the systemd in CentOS/RHEL 7
  8. setsebool Command in Linux
  9. How To Change Timezone for Oracle Grid Infrastructure
  10. How to Re-Balance BTRFS to Free Disk Space

You May Also Like

Primary Sidebar

Recent Posts

  • qemu-system-x86_64: command not found
  • timedatectl: command not found
  • mpirun.openmpi: command not found
  • startkde: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright