Red Hat Enterprise Linux 无法用VNC Viewer连接,报错:无法连接的主机,10065!
2008-04-01 18:30
337 查看
用VNC连接RHEL 4的桌面,出现下面的错误:
难道是RHEL防火墙的关系?尝试关闭掉防火墙, VNC可以正常连接,开启后就不行!
一时间用iptables还不能搞定,所以只好用VNC on SSH Tunnels的办法来解决, 在Windows上面用 PuTTY 来搞定!
设定如下:
下次连接的时候,在VNC Viewer的地址中输入 localhost:1
就可以通过防火墙,并看到画面了!
后来发现,之前之所以用iptables修改防火墙策略不能生效是因为我把新的规则追加在了系统防火墙之后,主要的解释请参考下面:
有时候,你可能会需要从 LAN 之外远程地进入 LAN。SSH 之类的安全服务可以用于到 LAN 服务的加密远程连接。对于拥有基于 PPP 资源(如调制解调器池或批量 ISP 帐号)的管理员来说,拨号进入可以被用来安全地避开防火墙,因为调制解调器连接是直接连接,通常位于防火墙/网关之后。然而,对于有宽带连接的远程用户来 说,你就需要制定些特殊规定。你可以配置 iptables 接受来自远程 SSH 客户的连接。例如,要允许远程 SSH 访问,你可以使用以下规则:
你可能还想为其它服务定义规则。关于 iptables 及其各类选项的完整信息,请参阅《红帽企业 Linux 参考指南》。
这些规则允许个体系统的出入交通,如单个 PC 直接连接到互联网或防火墙/网关;然而,它们并不允许防火墙/网关之后的机器使用这些服务。要允许 LAN 使用这些服务,你可以使用带有 iptables 过滤规则的 NAT。
于是,可以用下面的命令来完成:
这样,就可以不同SSH Tunnel,直接在VNC中进行连接了!
难道是RHEL防火墙的关系?尝试关闭掉防火墙, VNC可以正常连接,开启后就不行!
一时间用iptables还不能搞定,所以只好用VNC on SSH Tunnels的办法来解决, 在Windows上面用 PuTTY 来搞定!
设定如下:
下次连接的时候,在VNC Viewer的地址中输入 localhost:1
就可以通过防火墙,并看到画面了!
后来发现,之前之所以用iptables修改防火墙策略不能生效是因为我把新的规则追加在了系统防火墙之后,主要的解释请参考下面:
重要 | ||
---|---|---|
在创建 iptables 规则集合时,记住规则的顺序至关重要。例如:如果某个链指定了来自本地子网 192.168.100.0/24 的任何分组都应放弃,然后一个允许来自 192.168.100.13(在前面要放弃分组的子网范围内)的分组的链被补在这个规则后面(-A),那么这个后补的规则就会被忽略。你必须首先设置允许 192.168.100.13 的规则,然后再设置放弃规则。 要在现存规则链的任意处插入一条规则,使用 -I,随后是你想插入规则的链的名称,然后是你想放置规则的位置号码(1,2,3,...,n)。例如:
|
iptables -A INPUT -p tcp --dport 22 -j ACCEPT iptables -A OUTPUT -p udp --sport 22 -j ACCEPT |
这些规则允许个体系统的出入交通,如单个 PC 直接连接到互联网或防火墙/网关;然而,它们并不允许防火墙/网关之后的机器使用这些服务。要允许 LAN 使用这些服务,你可以使用带有 iptables 过滤规则的 NAT。
于是,可以用下面的命令来完成:
[root@redhat /root] # /sbin/iptables -I INPUT 1 -p TCP --dport 5901 -j ACCEPT [root@redhat /root] # /sbin/iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:5901 <-- 新加入的规则 RH-Firewall-1-INPUT all -- anywhere anywhere <-- Red Hat 默认的规则 Chain FORWARD (policy ACCEPT) target prot opt source destination RH-Firewall-1-INPUT all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) <-- Red Hat 默认并没有限制OUTPUT,所以不用额外的增加5901的OUTPUT策略! target prot opt source destination Chain RH-Firewall-1-INPUT (2 references) target prot opt source destination ACCEPT all -- anywhere anywhere ACCEPT icmp -- anywhere anywhere icmp any ACCEPT ipv6-crypt-- anywhere anywhere ACCEPT ipv6-auth-- anywhere anywhere ACCEPT udp -- anywhere 224.0.0.251 udp dpt:5353 ACCEPT udp -- anywhere anywhere udp dpt:ipp ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ftp ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:smtp REJECT all -- anywhere anywhere reject-with icmp-host-prohibited |
相关文章推荐
- Red Hat Enterprise Linux 无法用VNC Viewer连接,报错:无法连接的主机,10065!
- Red Hat Enterprise Linux 无法用VNC Viewer连接,报错:无法连接的主机,10065!
- Red Hat Enterprise Linux 无法用VNC Viewer连接,报错:无法连接的主机,10065!
- Red Hat Enterprise Linux 无法用VNC Viewer连接,报错:无法连接的主机,10065!
- Red Hat Enterprise Linux 7 (RHEL7)防火墙导致oracle客户端无法连接服务器
- 用Xmanager远程连接Red hat Enterprise Linux 5
- 用Xmanager远程连接Red hat Enterprise Linux 5
- Red Hat EnterPrise Linux 5.4下web服务器的综合使用(普通站点、虚拟主机、安全性、
- Red Hat Enterprise Linux AS release 4 下SSH无法使用无密码登陆的原因分析
- 在VMware Workstation 中安装 red hat enterprise linux 7.0 出现无法找到硬盘
- aws中Red Hat Enterprise Linux 7.3安装图形界面以及mac下的VNC连接
- Red Hat Enterprise Linux 5 (RHEL5)中物理网卡被peth0占用无法联网的问题解决方法
- Red Hat Enterprise Linux 5 - 使用链路聚合模式(mode=4)的绑定网络接口无法使用给定的 DHCP 地址
- 在Red Hat Enterprise Linux 3 U7下安装MYSQL 5.0.26
- Red Hat Enterprise Linux 5 (红帽子企业版5)下Samba, VSFTP配置与安装
- Red Hat Enterprise Linux (RHEL) 6.3 6.4 6.5 DVD ISO 下载地址
- VMware Workstation 中虚拟机 Red Hat Linux 9与主机共享上网
- Intel CPUs and Supported Red Hat Enterprise Linux
- Unix/Linux环境C编程入门教程(24) MySQL 5.7.4 for Red Hat Enterprise 7(RHEL7)的安装
- Red Hat Enterprise Linux AS release 4 (Nahant Update 4)yum及libaio安装