• 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

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. CentOS / RHEL : How to log all LVM commands
  2. What are the Types of DNS Servers
  3. How to Configure GNOME Console Login Banner in CentOS/RHEL 7 and 8
  4. How to Enable Password Aging in Linux with NIS
  5. passwd: gkr-pam: couldn’t update the login keyring password: no old password was entered
  6. Linux OS Service ‘psacct’
  7. pvmove Command Examples in Linux
  8. How to disable NUMA on EFI Boot Loaders using GRUB2 (CentOS/RHEL 6)
  9. id Command Examples in Linux
  10. RHEL 7 – RHCSA Notes – input / output redirection

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright