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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. Linux OS Service ‘setroubleshoot’
  2. Inconsistent Device Names Across Reboot Cause Mount Failure Or Incorrect Mount in Linux
  3. CentOS / RHEL : How to add iptable rules
  4. “lsb_release: command not found” – Fix in CentOS/RHEL
  5. How to connect to an Active Directory Domain using Realmd (Configure CentOS/RHEL 7 as active directory client)
  6. CentOS / RHEL : How to Change the login shell of the user
  7. “shutdown” Command Examples in Linux
  8. Extend volume on non-partitioned disk (XFS) under VMware guest
  9. How to disable auto deletion of the files in /tmp and /var/tmp directories in CentOS / RHEL 5,6
  10. “yum history” command examples to display, rollback, redo, undo yum transactions

You May Also Like

Primary Sidebar

Recent Posts

  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  • Unable to Start RDMA Services on CentOS/RHEL 7
  • How to rename a KVM VM with virsh
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary