2019年5月30日 星期四

vino-server (vnc-server) for xubuntu (xfce4 ubuntu)

感謝這篇重要文章
ubuntu 18.04 開始因為拿掉 vino-preferences 整合到 gnome 控制臺裡的關係, 桌面環境如果用的不是 gnome 等於就無法設定, 作者說有兩種方法, 一是裝 gnome-control-center, 但這個套件太多看了就不想裝了, 我也沒有試這條路, 我試的是使用 gsettings 設定.

將以下的內容存成一個 .sh 檔案 chmod a+x 後執行它.
唯須特別注意的是 password 必需 8 碼以上, 否則無效

#!/bin/bash
#
# Display all the preferences
#
gsettings list-recursively org.gnome.Vino
#
# [x] Allow other users to control your desktop
#     NOTE: Reverse Boolean
#
gsettings set org.gnome.Vino view-only false
#
# [ ] You must confirm each access to this machine
#
gsettings set org.gnome.Vino prompt-enabled false
#
# [ ] Require the user to enter this password
#
gsettings set org.gnome.Vino require-encryption false
gsettings set org.gnome.Vino authentication-methods "['none']"
gsettings set org.gnome.Vino vnc-password keyring
#
# [x] Require the user to enter this password
#
# Step 1. Ask for password (NOTE: Only tested with `bash` and `zsh`)
echo -n "VNC Password: " && read -s password < /dev/tty && echo ""
# Step 2. Set the preferences
gsettings set org.gnome.Vino authentication-methods "['vnc']"
gsettings set org.gnome.Vino vnc-password "$(echo $password | base64)"
# Step 3. Clear the `$password` variable
unset password
#
# [ ] Automatically configure UPnP router to open and forward ports
#
gsettings set org.gnome.Vino use-upnp false
#
# Show Notification Area Icon
#
# ( ) always  // Always
# (o) client  // Only when someone is connected
# ( ) never   // Never
#
gsettings set org.gnome.Vino icon-visibility client

沒有留言: