作者:Ki丶ng-james-LBJ威_112 | 来源:互联网 | 2017-07-25 05:03
1、首先安装vnc的服务器端yuminstalltigervnc-server2、启动vnc服务运行vncserver或者servicevncserverstart&
1、首先安装vnc的服务器端
yum install tigervnc-server
2、启动vnc服务
运行vncserver或者service vncserver start
New 'was1.com:1 (root)' desktop is was1.com:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/was1.com:1.log
设置远程登录密码,不要使用小键盘,在vncpasswd下小键盘的作用相当于上下左右,www.linuxidc.com没有数字功能,切记
3、修改/etc/sysconfig/vncservers
# 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 this URL:
# http://kbase.RedHat.com/faq/docs/DOC-7028
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# 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 -localhost"
VNCSERVERS="1:root 2:test"
VNCSERVERARGS[2]="-geometry 800x600"
可以复制
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"
这两行配置进行修改。其中geometry 800x600 意思为以800*600的分辨率远程桌面 ;nolisten tcp 不侦听tcp localhost为只允许本地主机连接
修改配置完重启服务service vncserver restart
4、在客户端安装vnc
windows用户可直接下载安装vnc
linux需要安装tigervnc
vncviewer root@服务器地址:1或者2
5、在服务器上设置vncserver开机自启动
chkconf vncserver on
6最后一点:开通vnc的服务器一定要设置防火墙,关闭防火墙。。。