• 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

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. Understanding OS load average and run queue/blocked queue in terms of CPU utilization in Linux
  2. MySQL Server Error – “Can’t Create A New Thread (errno 11)”
  3. Change default kernel (boot with old kernel) – CentOS/RHEL/OEL 7
  4. “The requested URL returned error: 403 Forbidden” – yum update error
  5. LVM Configuration : Physical Volume (PV) Operations/Utilities
  6. CentOS/RHEL 8: “ACPI MEMORY OR I/O RESET_REG” Server Hung after reboot
  7. CentOS / RHEL : How to find UUID of a device or filesystem
  8. CentOS / RHEL : How to Disable / Enable direct root and non-root user ssh login
  9. Common NFS mount options in Linux
  10. CentOS / RHEL 5 : dm-multipath file /etc/sysconfig/mkinitrd/multipath explained

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable ACPI in CentOS/RHEL 7
  • How to Use real-time query to access data on a physical standby database
  • CentOS/RHEL 8: “ACPI MEMORY OR I/O RESET_REG” Server Hung after reboot
  • How to Create a Physical Standby Database by Using SQL and RMAN Commands
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary