Disable Control-Alt-Delete on Linux
Introduction
Linux servers can be rebooted by using the infamous Control-Atl-Delete key combination. This is not always desirable in environments where a combination of Windows and Linux administrators manage the infrastructure.
On Windows, the key combination will simply lock up the console but on Linux it will cause an OS reboot. This blog will provide steps on how to disable the key combination on RHEL and OEL.
Linux 7 and 8
For these versions, Systemd is the system and service manager that controls management of services. It has a good management design with better dependency control, logging, and grouping. The step to disable the key combination is as follows.
1- As the root user or user with appropriate sudo privileges, run the following command.
sudo systemctl mask ctrl-alt-del.target
No additional steps are needed. Its recommended to validate the server is no longer impacted by the key combination.
Linux 6
System startup for Linux 6 is managed by the Init process. The steps to disable the key combination is as follows.
1- Create a new file /etc/init/control-alt-delete.overide.
2- Add the following line to this new file.
exec /bin/true
3- Reload the Init process to pick up the newly added file.
initctl reload-configuration control-alt-delete
Side Note: There is a default configuration file /etc/init/control-alt-delete.conf. This file should be left unmodified.
Linux 5 and 4
The Init process exists in these Linux versions. The steps to disable the key combination is as follows.
1- Comment out the following line in /etc/inittab by adding a # sign at the beginning of the line.
# ca::ctrlaltdel:/sbin/shutdown -t3 -r now
2- Reload the Init process to pick up the changes.
kill -HUP 1
InfoSapient specializes in the delivery of Managed Services for Oracle Databases and Oracle E-Business Suite both On-Premise and in the Cloud. When you are ready for an upgrade, migration, or are looking for Managed Services of your Oracle environment, contact us for a no obligation review to get started.
The information contained herein is not legal advice. Any mention of a specific product, individual or company does not constitute an endorsement unless otherwise specified.