博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
win7 远程桌面连接centos 6.5
阅读量:7235 次
发布时间:2019-06-29

本文共 3919 字,大约阅读时间需要 13 分钟。

 

首先安装tigervnc-server:

yum install tigervnc-server

 

安装好后,设置 vi /etc/sysconfig/vncservers

'
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: # https://access.redhat.com/knowledge/solutions/7027 # 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="1:root" VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost" VNCSERVERS="2:work" VNCSERVERARGS[2]="-geometry 1024x768 -nolisten tcp -localhost"

 

启动vncserver服务器:

 

在服务器上可以看到打开的vnc端口:

 

在windows上安装viewvnc,输入ip地址和端口号进行连接:

 

输入密码:

可以看到成功的连接上了centos 6.5的桌面:

/etc/sysconfig/iptables

# Firewall configuration written by system-config-firewall# Manual customization of this file is not recommended.*filter:INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 6000:6010 -j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 177 -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT

关闭防火墙: /etc/init.d/iptables stop 使用root账号

 

 

win7 VNC远程centos

发表于2年前(2013-12-16 20:09)   阅读(
942) | 评论() 2人收藏此文章, 我要收藏
0

首先需要检查一下服务器是否已经安装了VNC服务,检查服务器的是否安装VNC的命令如下:

1
rpm -qa | grep vnc

 

使用了上面的命令我这边返回的信息是下面的(如果没有任何显示,则说明系统没有安装vnc包)

如果没有安装vnc可以使用下面命令进行安装:

1
yum install tigervnc tigervnc-server

 

使用下面的命令编辑配置文件:

1
vi /etc/sysconfig/vncservers

 

使用上面命令的时候,可能您服务器上面已经存在这个配置文件,也可能您服务器上面不存在这个配置文件,将下面的内容添加到配置文件内:

1
2
VNCSERVERS=
"1:root"
VNCSERVERARGS[1]=
"-geometry 800x600"

下面这段是上面所讲配置文件注解,做参考之用:

1
2
3
#这个是配置远程桌面登录的用户名,如果两个用户,则使用VNCSERVERS="1:user1 2:user2",依次类推,默认情况下,1:user1对应5901,2:user2对应5902(VNC的默认监听端口是5900,监听端口规则为5900+usernumber),如下
VNCSERVERS=
"usernumber:myusername"
#下面这项配置为登录桌面配置,其中的“1”为用户序号,800x600为分辨率,-nolisten tcp为阻止tcp包,-localhost代
1
2
3
4
表只监听本地
VNCSERVERARGS[1]=
"-geometry 800x600 -nolisten tcp -localhost"
#如果想阻止http包,可以使用如下配置
VNCSERVERARGS[1]=
"-geometry 800x600 -nolisten tcp -nohttpd -localhost"

使用下面的命令为vnc设置密码(需要使用su 切换到要设置vnc密码的用户上,比如:su user1,其中user1就是在上面配置文件内写的帐号)

1
vncpasswd

设置好密码之后,就是启动VNC服务了,启动VNC服务的时候也需要用su user1(user1就是在上面配置文件内写的帐号)切换到要启动服务的帐 号上(很多朋友在使用DirectSpace默认的桌面VNC的时候,遇到无法连接“10061错误”,即可在ssh下输入下面命令解决!)

1
vncserver

 

(此处的8与vnc登陆的 192.168.1.193:8冒号后8对应)  

其他命令,比如重启VNC服务就用下面的命令:

1
service vncserver restart

 

设置VNC服务开机启动用下面的命令:

1
2
3
4
5
chkconfig vncserver on
 
chkconfig --list vncserver
 
vncserver       0:off   1:off   2:on    3:on    4:on    5:on    6:off

 

注意:如果在连接上之后,出现灰屏或者黑屏,可以按照下面的方法设置

1
2
3
4
5
vi /root/.vnc/startup
 
#twm &    #注释掉这一行
 
gnome-session &   #添加这一行

 

 

【Linux】VNCServer设置时的一个问题——bad display name

(2013-03-15 11:33:56)
标签:

分类:
这个问题是在设置Linux服务器中的VNCServer时发现的,在开启一个服务(vncserver :1),或者重启vncserver的时候(如下所示)出现。
[root@host144 ~]# service vncserver restartShutting down VNC server: 1:root 2:oracle [ OK ]Starting VNC server: 1:root xauth: (stdin):1: bad display name "host144:1" in "add" command (出现问题的地方,其中“host144”为主机名,下面的设置要与这里保持一致。) New 'host144:1 (root)' desktop is host144:1 Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/host144:1.log 2:oracle xauth: (stdin):1: bad display name "host144:2"in"add" command New 'host144:2 (oracle)' desktop is host144:2 Starting applications specified in /home/oracle/.vnc/xstartup Log file is /home/oracle/.vnc/host144:2.log [ OK ] 解决方法: [root@host144 .vnc]# vi /etc/hosts #用vi文本编辑器打开该文件 127.0.0.1 host144 localhost.localdomain localhost
#服务器ip   主机名 后面的可不设(中间用逗号隔开,完成后保存即可。)
 
from: http://www.cnblogs.com/jankie/archive/2012/10/19/2730505.html
对原文有修改。

 

 

 

转载于:https://www.cnblogs.com/zhengah/p/5198270.html

你可能感兴趣的文章
HP LaserJet Pro P1106网络打印机64位驱动安装
查看>>
【博客话题】我的linux戏曲
查看>>
继之前SCVMM WinRM问题后重新添加群集后Windows Azure Pack创建虚拟机失败
查看>>
第十六集被忽视的帧中继:原理及实验
查看>>
关于Ubuntu上Eclipse不显示手机设备
查看>>
iPhone的Push(推送通知)功能原理浅析
查看>>
Oracle 11g Release 1 (11.1) 游标——SQL 游标(隐式)
查看>>
欧拉函数
查看>>
用groovy写抓票程序
查看>>
设计资源推荐-20个漂亮的免费PSD图标格式
查看>>
学用MVC4做网站:序
查看>>
mysql kill操作
查看>>
Go Revel - i18n(国际化)
查看>>
MVC应用程序JsonResult()的练习
查看>>
VBS解析时候遇到时间
查看>>
Android应用公布的准备——渠道注冊与认证
查看>>
第四章 类加载机制
查看>>
字符和字符串
查看>>
使用Xamarin.Forms平台开发移动应用指南
查看>>
javascript中的链表结构
查看>>