本帖最后由 klum 于 2014-1-16 14:36 编辑
对于CentOS系统的服务器,一般用putty软件SSH连接 由于是纯命令操作的,难免很多用户不懂,习惯了Windows系统的图形操作界面,使用Linux系统相信都是一头雾水.但是CentOS系统也是有图形操作界面的,只是相比起Windows系统的图形操作界面可能没那么完善. 以下简单介绍下CentOS系统安装VNC 实现远程桌面图形操作的方法: 1 SSH远程连接登陆服务器 2 安装 yum -y install vnc-server 由于CentOS 6采用的是TigerVNC,所以,CentOS 6版本以上用户请使用yum install tigervnc tigervnc-server替代上面的命令! 3,配置VNC密码 [root@tanvps ~]#vncpasswd
Password:******
verify:****** 4,编辑VNC配置文件 [root@colud ~]# vi /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: # 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" 取消前面的# ,将myusername 改为当前使用的root,VNC连接端口是2 #VNCSERVERS="1:root 2:admin" 这样则写代表新增两个用户进来 # VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost" 取消前面的# ~ ~ ~ ~ "/etc/sysconfig/vncservers" 19L, 765C 保存退出
5 启动VNC
[root@tanvps ~]# chkconfig vncserver on //设置为开机启动 [root@tanvps ~]# vncserver 重启VNCserver 注意:可能当你重启vncserver服务时出现以下错误提示 [root@colud ~]# /etc/init.d/vncserver restart 这样也可重启VNCserver
很是费解,后来搜索发现需要增加3个包即可解决该问题. #yum install pixman pixman-devel libXfont
连接失败原因也有可能是防火墙导致,我这里是直接关闭防火墙.当然也可以通过命令加入例外端口,而不必关闭防火墙 6 关闭防火墙
##临时关闭防火墙
service iptables stop
##永久关闭防火墙
chkconfig iptables off 现在在直接的电脑使用VNC客户端软件来连接
连接成功 要求输入密码;
<!--[if !supportLists]-->这里再补充说明下停止和启动 vnc server: 1)停止vnc server (注意: kill 和冒号之间有空格) #vncserver -kill :1 #vncserver -kill :2 注意到vncserver只能由启动它的用户来关闭,即时是root也不能关闭其它用户开启的vncserver,除非用kill命令暴力杀死进程。 2)指定显示端口号启动VNC server: #vncserver :3 $vncserver :6
|