
我正在將 Ubuntu 14.04 用於具有多個使用者的電腦。我已配置以下內容:
/etc/profile.d/all_users.sh
gsettings set org.gnome.Vino disable-background true
gsettings set org.gnome.Vino authentication-methods "['none']"
gsettings set org.gnome.Vino enabled true
gsettings set org.gnome.Vino icon-visibility 'client'
gsettings set org.gnome.Vino lock-screen-on-disconnect false
gsettings set org.gnome.Vino notify-on-connect true
gsettings set org.gnome.Vino prompt-enabled true
gsettings set org.gnome.Vino require-encryption false
gsettings set org.gnome.Vino view-only false
這很好用。因為所有使用者在登入時都會獲得此設定。
問題是當我 ssh 到這台機器時。我收到以下錯誤:
dconf-警告 **:無法提交 dconf 的變更:沒有 X11 $DISPLAY 時無法自動啟動 D-Bus
所以我想知道是否有人知道我該怎麼做:
- 當我 ssh 進入這台機器時,避免執行 profile.d 腳本
- 配置 profild.d 腳本,以便它檢測到它是 ssh 腳本並從腳本返回
任何幫助是極大的讚賞。
答案1
當使用者透過 ssh 登入時,$SSH_CLIENT 將在其環境中設定。因此,您需要做的就是將設定包含在if
語句中:
if [ "$SSH_CLIENT" ] ; then
# gsettings set ...
fi