Linux下屏蔽Ctrl+Alt+Delete

一、Redhat 5.X/CentOS5.X
--------------------------------------
使用Root帳戶登錄系統,修改/etc/inittab
# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now

這句前面加「#」註銷掉 就能夠了!
--------------------------------------

二、Fedora 10/11

按照上面的方法,當咱們修改/etc/inittab文件時咱們發現該文件的內容變了以下:
---------------------------------------
# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# System initialization is started by /etc/event.d/rcS
#
# Individual runlevels are started by /etc/event.d/rc[0-6]
#
# Ctrl-Alt-Delete is handled by /etc/event.d/control-alt-delete
#
# Terminal gettys (tty[1-6]) are handled by /etc/event.d/tty[1-6] and
# /etc/event.d/serial
-----------------------------------------

注意看提示,內容已經告訴咱們該如何去作了。

編輯/etc/event.d/control-alt-delete

[root@mypc ~]# vim /etc/event.d/control-alt-delete
-----------------------------------------------------
# control-alt-delete - emergency keypress handling
#
# This task is run whenever the Control-Alt-Delete key combination is
# pressed. Usually used to shut down the machine.
start on control-alt-delete
exec /sbin/shutdown -r now "Control-Alt-Delete pressed"
-----------------------------------------------------
上面的內容最後兩句註釋掉 就行了!
 
注意:圖形界面下Ctrl+Alt+Delete仍然有效,可是在字符界面被禁用了。
相關文章
相關標籤/搜索