# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see
# <URL:>.
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# Use "-nohttpd" to prevent web-based VNC clients connecting.
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"

将最后两行配置信息取消注释,添加系统账号
VNCSERVERS="1:root 2:etl"
VNCSERVERARGS[1]="-geometry 1024x768 -nolisten tcp -nohttpd "
VNCSERVERARGS[2]="-geometry 1024x768 -nolisten tcp -nohttpd "
VNCSERVERS 是用来设定可以使用VNC的服务器账号,可以设定多个,例如上面root、etl,但是中间要用空格隔开。realvnc 配置使用VNCVIEWER登录时,192.168.48.128:1表示是以root账号登录,以此类推。
关于参数配置说明:
1:-geometry 表示桌面分辨率,默认为1024x768,所以上面的1024x768也可以不写。
2:-nohttpd 表示不HTTP端口(58xx)。
3:-nolisten tcp 表示不TCP端口(60xx)
4:-localhost 只运行从本机访问。
5:AlwaysShared 默认只允许一个VNCVIEWER连接,此参数表示同一个显示端口允许多用户同时登录.
6:-depth 表示色深,参数有8,16,24,32.
7: SecurityTypes None 登录不需要密码认证VncAuth默认值,要密码认证。
3、设置VNC用户密码
如果此时不设置VNC用户密码,启动vncserver服务,则会报如下错误:
[root@localhost ~]# service vncserver start
Starting VNC server: 1:root [FAILED]
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/shumachanpin/article-43005-2.html
舍
加油~~永远支持三只