vnc远程链接

1.服务端

vim /etc/sysconfig/vncservers


[root@localhost ~]# vim  /etc/sysconfig/vncservers


# THIS FILE HAS BEEN REPLACED BY /lib/systemd/system/[email protected]
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1024x768"


vim /root/.vnc/xstartup

#!/bin/sh

# Uncomment the following two lines for normal desktop:

# unset SESSION_MANAGER

# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources

xsetroot -solid grey

vncconfig -iconic &

xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

gnome-session &

启动服务:

vncserver

vncserver :1


停止服务:

vncserver -kill :1


客户端:

安装vnc-viewer

创建新链接:ip:1

(:对应服务器的1)

防火墙设置:

VNC服务使用的端口号与桌面号相关,VNC使用TCP端口从5900开始,对应关系如下
桌面号为“1”  ---- 端口号为5901
桌面号为“2”  ---- 端口号为5902
桌面号为“3”  ---- 端口号为5903


桌面号为“1”  ---- 端口号为5801
桌面号为“2”  ---- 端口号为5802
桌面号为“3”  ---- 端口号为5803


firewall-cmd --zone=public --add-port=端口号/tcp --permanent


参考文献:http://blog.csdn.net/petercnmei/article/details/51627964

http://blog.csdn.net/huang_tg/article/details/5631178

http://www.ha97.com/4634.html

http://blog.csdn.net/lijjianqing/article/details/552239554.html

http://jingyan.baidu.com/article/6c67b1d6f003ca2787bb1ed6.html

http://blog.csdn.net/bourne_again/article/details/9289285

http://blog.csdn.net/lijjianqing/article/details/55223955


你可能感兴趣的:(vnc远程链接)