sh 从命令行激活Ubuntu中的VNC支持(用于活动会话)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 从命令行激活Ubuntu中的VNC支持(用于活动会话)相关的知识,希望对你有一定的参考价值。

#!/bin/sh

# This assumes you have access to the system via SSH already, and need 
# remote VNC access as the same user, and you want only the primary display.
export DISPLAY=:0

# Encoded password with http://www.motobit.com/util/base64-decoder-encoder.asp
export VNC_PASSWORD="dm5jX3Bhc3N3b3JkNzE="  # vnc_password71
export VNC_PASSWORD="dm5jX3Bhc3M=" # vnc_password (a character limit is enforced?)
# Sadly many common VNC clients don't support encryption.
export USE_ENCRYPTION=false  # alternatively "true"

# Set a bunch of useful defaults. (for remote support cases.)
gsettings reset org.gnome.Vino network-interface
gsettings set org.gnome.Vino enabled true
gsettings set org.gnome.Vino prompt-enabled false 
gsettings set org.gnome.Vino notify-on-connect true
gsettings set org.gnome.Vino require-encryption ${USE_ENCRYPTION}  
gsettings set org.gnome.Vino vnc-password "${VNC_PASSWORD}"

# List all current settings
for i in `gsettings list-keys org.gnome.Vino`; do 
  echo $i `gsettings get org.gnome.Vino $i`; 
done

# Run the server
/usr/lib/vino/vino-server

以上是关于sh 从命令行激活Ubuntu中的VNC支持(用于活动会话)的主要内容,如果未能解决你的问题,请参考以下文章

Ubuntu配置VNC server

VNC可以正常连接Linux,但是连接后没有命令行

windows怎么开启vnc服务

ubuntu17.10如何使用vnc,正常显示gnome和kde

ubuntu sh脚本激活conda 虚拟环境

为AWS上的ubuntu安装LXDE桌面和VNC