标签:vnc
Server:CentOS 6.5 x86_64
Client: Windows 7
1. [root@gxh ~]# yum install tigervnc-server -y
2. 修改vnc主配置文件
[root@gxh~]# vim /etc/sysconfig/vncservers
找到最后两行,去掉注释,修改为
VNCSERVERS="1:root" ###第一个远程连接的账户为root
VNCSERVERARGS[1]="-geometry1200x900 "
###root远程登录分辨率为1200x900
3. 启动vnc
[root@gxh~]# vncserver
Youwill require a password to access your desktops.
Password: ###这里输入连接远程桌面的密码
Verify: ###再次输入密码
xauth:(stdin):1: bad display name"gxh:1" in "add" command
New‘gxh:1 (root)‘ desktop is gxh:1
Creatingdefault startup script /root/.vnc/xstartup
Startingapplications specified in /root/.vnc/xstartup
Logfile is /root/.vnc/gxh:1.log
4. 修改xstartup文件
[root@gxh~]# vim .vnc/xstartup
将最后两行注释掉,在最后一行添加如下:
#xterm-geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm&
gnome-session&
5. 设置vncserver开机启动
[root@gxh~]# chkconfig vncserver on
6. 设置防火墙
VNCserver 监听的端口从 5900 开始,display:1 监听 5901,display:2监听 5902,以此类推。
[root@gxh~]# iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
[root@gxh~]# service iptables save
7. VNC Server配置完成
8. 安装vnc客户端
1.9. 远程连接vnc服务器
10. 添加一个display
[root@gxh ~]# vncserver
xauth: (stdin):1: bad display name "gxh:2" in"add" command
New ‘gxh:2 (root)‘ desktop is gxh:2
Starting applications specified in/root/.vnc/xstartup
Log file is /root/.vnc/gxh:2.log
11. 列出所有display
[root@gxh ~]# vncserver -list
TigerVNC server sessions:
X DISPLAY # PROCESSID
:1 2403
:2 2998
12. 关闭一个display
[root@gxh ~]# vncserver -kill :2
Killing Xvnc process ID 2998
[root@gxh ~]# vncserver -list
TigerVNC server sessions:
X DISPLAY # PROCESSID
:1 2403
13. 修改远程登录密码
[root@gxh ~]# vncpasswd
Password:
Verify:
VNC Viewer
TightVNC
RealVNC
TigerVNC
本文出自 “菜鸟行天下” 博客,请务必保留此出处http://guoxh.blog.51cto.com/10976315/1892103
标签:vnc
原文地址:http://guoxh.blog.51cto.com/10976315/1892103