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

The Geek Diary

HowTos | Basics | Concepts

  • Solaris
    • Solaris 11
    • SVM
    • ZFS
    • Zones
    • LDOMs
    • Hardware
  • Linux
    • CentOS/RHEL 7
    • RHCSA notes
    • SuSE Linux Enterprise
    • Linux Services
  • VCS
    • VxVM
  • Interview Questions
  • oracle
    • ASM
    • mysql
    • RAC
    • oracle 12c
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Hadoop
    • Hortonworks HDP
      • HDPCA
    • Cloudera
      • CCA 131

How to Disable “alt+ctrl+Del” Key Combination causing reboot in CentOS/RHEL 4,5

By admin

The key combination “Ctrl+Alt+Del”, when pressed on a virtual console (black-screen tty), causes the system to reboot. This is the default behavior and sometimes people don’t like this feature as it may cause accidental reboots of the system. The post provides the procedure on how to disable “alt+ctrl+del” key combination in order to prevent an accidental shutdown.

In case of CentOS CentOS/RHEL 4,5 the shutdown command is controlled by /sbin/init, described in /etc/inittab as:

# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now

Follow the steps outlined below to disable the key combination causing the system to reboot on when pressed on a virtual console.

Disabling “alt+ctrl+Del” Key Combination completely for all users

1. comment out the line in /etc/inittab, adding “#” on the top of the line:

# vi /etc/inittab
# ca::ctrlaltdel:/sbin/shutdown -t3 -r now

2. send HUP signal to init(pid=1) to reload /etc/inittab

# kill -HUP 1

Generating a log entry when the “alt+ctrl+Del” key combination is pressed without rebooting

The inittab entry could be modified to run a different (innocuous) command, e.g., logger (to generate a log entry):

# vi /etc/inittab
# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/bin/logger -p authpriv.warning -t init "Console-invoked Ctrl-Alt-Del was ignored"

Restricting the “alt+ctrl+Del” Key Combination to certain users only

1. In addition to above 2 methods, the “alt+ctrl+del” key combination can be restricted to certain users only. Add the -a option to the shutdown command on the referenced line in /etc/inittab, i.e.:

# vi /etc/inittab
# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now -a

2. Populate a new /etc/shutdown.allow file with users (one per-line) which should be allowed to use Ctrl-Alt-Del, e.g.:

# cat /etc/shutdown.allow 
user01
user02

Using the above example, if “Ctrl-Alt-Del” is pressed from a virtual console (one of the black-screen ttys), it will only trigger a shutdown if the users root, user01, or user02 are logged in.

3. After doing this, tell the init process to re-read /etc/inittab via use of the command:

# init q
How to disable “Alt+Ctrl+Del” causing system reboot in CentOS/RHEL 7
How to disable Ctrl+Alt+Del causing system reboot in CentOS/RHEL 6

Filed Under: CentOS / RHEL 4, CentOS/RHEL 5, Linux

Some more articles you might also be interested in …

  1. How to Install and Configure peripety utility in CentOS/RHEL 8
  2. CentOS / RHEL : How to configure alias (virtual interface) of bond interface (bondx:y)
  3. CentOS / RHEL : How to delete LUKS encrypted device
  4. How to Enable/Disable CPUs (Limiting CPU count) in CentOS / RHEL
  5. Linux OS Service ‘ntpd’
  6. How to fix the error “host key verification failed”
  7. How to Find Number of CPU Sockets on a CentOS/RHEL System
  8. SSSD Service Failing with “SSSD is already running” in CentOS/RHEL 7
  9. How to create sparse files in Linux using ‘dd’ command
  10. Oracle Software Group Accounts OSDBA, OSOPER, Oracle Inventory group

You May Also Like

Primary Sidebar

Recent Posts

  • Linux OS Service ‘cups’
  • “Warning: RPMDB altered outside of yum.” – On installing/updating/erasing a package using YUM command
  • How to Generate Unique IDs For MysQL Cluster Backups
  • Oracle 11g – New ASM features
  • ASM Fast Mirror Resync Feature – Example To Simulate Transient Disk Failure And Restore Disk
  • Archives
  • Contact Us
  • Copyright

© 2019 · The Geek Diary