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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • 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 Use Iperf to Test Network Performance in Linux
  2. How to enable additional scsi logging in CentOS/RHEL
  3. How to Install SSHFS on CentOS/RHEL/Ubuntu
  4. restorecon Command Examples in Linux
  5. How to Find Number of CPU Sockets on a CentOS/RHEL System
  6. AdGuardHome – A network-wide software for blocking ads & tracking (Command Examples)
  7. SSH Connection Refused by TCP Wrapper
  8. aws-google-auth: Command-line tool to acquire AWS temporary (STS) credentials using Google Apps as a federated (Single Sign-On) provider
  9. elixir: Elixir programming language interpreter
  10. How to Start NTP Service With Slewing Enabled in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • gml2gv Command Examples
  • glow Command Examples
  • glib-compile-resources Command Examples
  • glances Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright