2012年7月11日水曜日

Ubuntu 12.04のログイン画面(LightDM)から電源系のボタンを取り除く

Ubuntu 12.04のLightDMのログイン画面からシャットダウン、再起動のボタンを消したい事情が発生したので、検索かけてたら、あたったので翻訳。
http://askubuntu.com/questions/137336/how-do-i-remove-the-shutdown-button-only-on-the-login-screen

原文
Even if you cannot hide the buttons, you can configure your system so that the lightdm user does not have permissions to shutdown or restart the system. Since the greeter runs as the lightdm user, this should solve your issue. Create two new files in /var/lib/polkit-1/localauthority/50-local.d, call them disable-lightdm-shutdown.pkla and disable-lightdm-restart.pkla and apply the contents as below. Note: You can also stick these into one file.

Shutdown:
[Disable Shutdown]
Identity=unix-user:lightdm
Action=org.freedesktop.consolekit.system.stop
ResultAny=no
ResultInactive=no
ResultActive=no

Restart:
[Disable Restart]
Identity=unix-user:lightdm
Action=org.freedesktop.consolekit.system.restart
ResultAny=no
ResultInactive=no
ResultActive=no
訳文
それらのボタンを隠せなかったとしても、lightdm ユーザーにシャットダウン・リブートの権限を与えないようにシステムを設定することが可能である。greeter[多分ログイン画面のこと]はlightdm ユーザーで動いているので、これで問題は解決するはずだ。
/var/lib/polkit-1/localauthority/50-local.dの中に、2つのファイル、disable-lightdm-shutdown.pklaとdisable-lightdm-restart.pklaとを作り、中身は以下のようにする。
1つのファイルにしてもいける。
[以下略]
なるほどねー。ログイン画面はlightdmユーザーとして起動してるのかぁ。ってそりゃそうか。

0 件のコメント:

コメントを投稿