[20200323]避免按ctrl+alt+del重新啟動伺服器(centos 7).txt

lfree發表於2020-03-23

[20200323]避免按ctrl+alt+del重新啟動伺服器(centos 7).txt

--//想在centos 7關閉按ctrl+alt+del重新啟動伺服器的功能,檢查發現與centos 6不同。
--//連結:http://blog.itpub.net/267265/viewspace-2638238/ => [20190313]避免按ctrl+alt+del重新啟動伺服器.txt

#  ls -l  /etc/systemd/system/ctrl-alt-del.target
ls: cannot access /etc/systemd/system/ctrl-alt-del.target: No such file or directory

# systemctl mask ctrl-alt-del.target
Created symlink from /etc/systemd/system/ctrl-alt-del.target to /dev/null.

# ls -l  /etc/systemd/system/ctrl-alt-del.target
lrwxrwxrwx. 1 root root 9 Mar 23 10:55 /etc/systemd/system/ctrl-alt-del.target -> /dev/null

--//反轉執行systemctl unmask ctrl-alt-del.target,實際上這樣並不阻止按鍵,僅僅導致操作不會重啟伺服器。
--//在GUI下:

# gsettings get org.gnome.settings-daemon.plugins.media-keys logout
'<Control><Alt>Delete'

Disabling for all users

1. Create a file under the directory '/etc/dconf/db/local.d/' with the settings to be applied globally. For example:

# cat /etc/dconf/db/local.d/00-disable-CAD
[org/gnome/settings-daemon/plugins/media-keys]
logout=''

2. Update the dconf settings:

# dconf update

Verify if the 'ctrl-alt-del' key combination is disabled globally.

# gsettings get org.gnome.settings-daemon.plugins.media-keys logout
''


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2682012/,如需轉載,請註明出處,否則將追究法律責任。

相關文章