[FrontPage] [TitleIndex] [WordIndex

This is a read-only archived version of wiki.centos.org

停用 Gnome 顯示管理員(GDM)歡迎畫面的用戶清單

在 CentOS 6 和 7,GDM 的歡迎/登入畫面備有一個選單,把系統上所有用戶的名稱及圖像列舉出來。在很多情況下,就安全性或效率而言,這都不是理想的表現。不但如此,由於 GDM 要掃描所有帳戶的主目錄來尋找圖像作顯示之用,系統有可能會出現顯著延誤,而且所有主目錄將會被(自動)掛載。這個提示描述如何停止上述行為。

CentOS 6 及 7 分別採用 Gnome 2 及 3,因此要修改的設定並不相同。

1. CentOS 6

CentOS 6 採用 Gnome 2,它的設定理論上是透過 gconftool-2 更改的,但利用 gconftool-2 來修改這些設定似乎會出現問題。一個能可靠地停用圖像化用戶清單的方法就是以 root 的身份編輯 /etc/gconf/gconf.xml.defaults/%gconf-tree.xml,並搜尋第二次出現,自成一行的 disable_user_list(據我所知第一次出現是預設/文獻的設定),然後把設定值改成 true。這樣該行便會變成

<entry name="disable_user_list" mtime="1415197704" schema="/schemas/apps/gdm/simple-greeter/disable_user_list" type="bool" value="true"/>

當 gdm 重新啟動時(例如登出時),設定便會生效。

2. CentOS 7

CentOS 7 採用 Gnome 3,它的設定是透過 dconf 管理的資料庫而更改的。

2.1. 停用用戶清單

這個方法在上游發行商的 Desktop_Migration_and_Administration_Guide 第 10.4.4 部份有描述。你也可以在這裡停止顯示 restart 及 shutdown 的按鈕。

以 root 身份,建立 /etc/dbconf/db/gdm.d/00-login-screen 檔並加入以下內容

[org/gnome/login-screen]
#Do not show the user list
disable-user-list=true
#Do not show restart buttons
disable-restart-buttons=true

儲存檔案並執行以下指令

dconf update 

2.2. 停止掃描用戶的主目錄

這個 Gnome 3 選項沒有文獻,但似乎有效。

以 root 身份編輯 /etc/gdm/custom.conf 檔,好讓 greeter 部份包含

[greeter]
IncludeAll = false

儲存檔案並執行以下指令

dconf update 

Translation of revision 14


2023-09-11 07:23