1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > centos6.5远程桌面连接(VNC\SPice)

centos6.5远程桌面连接(VNC\SPice)

时间:2020-06-08 12:41:49

相关推荐

centos6.5远程桌面连接(VNC\SPice)

在Linux下用vnc远程桌面,centos中默认没有安装VNC

查询系统是否安装VNC

# rpm -q tigervnc tigervnc-server

安装VNC服务

# yum install tigervnc tigervnc-server -y

为vncserver设置密码

[root@localhost ~]# vncserverYou will require a password to access your desktops.Password:<输入vnc登录密码>Verify:<再次输入vnc登录密码>New 'localhost.localdomain:1 (root)' desktop is localhost.localdomain:1Creating default startup script /root/.vnc/xstartupStarting applications specified in /root/.vnc/xstartupLog file is /root/.vnc/localhost.localdomain:1.log[root@localhost ~]#

配置vnc

为了防止黑屏,需要修改一下/root/.vnc/xstartup,注释下面两行并添加一行内容

# vi /root/.vnc/xstartup

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

gnome-session &

修改用户配置文件

# vi /etc/sysconfig/vncservers

注释上面两行,最后增加下面两行

VNCSERVERS="2:root"VNCSERVERARGS[2]="-geometry 1024x768 -depth 32"

改变xstartup的权限

# chmod 777 /root/.vnc/xstartup

防火墙开放端或者也可以直接关闭防火墙

查看端口号

# netstat -antpl

关闭防火墙

# service iptables stop

打开防火墙的监听端口

vi /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT //在此行下方增加

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5900:5903 -j ACCEPT

保存退出,重启防火墙

service iptables restart

启动VNC

# /etc/init.d/vncserver start

然后在Windows中用客户端登录

输入设置的VNC密码

连接成功

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。