如果上面的文字过于简略导致不便理解,请参考下面这篇文章,作者:laptop。service iptables stop
service iptables status
![]()
less /etc/rc.d/init.d/iptables
<-----
IPTABLES=iptables
IPTABLES_DATA=/etc/sysconfig/$IPTABLES
IPTABLES_CONFIG=/etc/sysconfig/$...{IPTABLES}-config
----->
![]()
vi /etc/sysconfig/iptables
<-----
# Firewall configuration written by redhat-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 7778 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 7777 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 7100 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 6000 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5900 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 4443 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 177 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 23 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
----->
![]()
vi /etc/services ...{用vi的"/数字"找到端口号附近的区域,填加下列信息}
<-----
oratns 1521/tcp # Oracle listener
......
vnc+0 5900/tcp # VNC Server Port + 0
vnc+1 5901/tcp # VNC Server Port + 1
vnc+2 5902/tcp # VNC Server Port + 2
......
oraSSL 4443/tcp # Oracle Apache 1.3.22
......
oraweb 7777/tcp # Oracle Apache 1.3.22
orassl 7778/tcp # Oracle Apache 1.3.22
----->
![]()
service iptables start
service iptables status
<-----
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 all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:orassl
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:oraweb
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:xfs
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:x11
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:vnc+2
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:vnc+1
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:vnc+0
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:oraSSL
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:oratns
ACCEPT udp -- anywhere anywhere state NEW udp dpt:xdmcp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:smtp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:telnet
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ftp
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
----->
![]()
cat /etc/rc.d/init.d/xfs | grep -e config -e daemon
<-----
# chkconfig: 2345 90 10
# config: /etc/X11/fs/config
daemon xfs -droppriv -daemon
----->
![]()
vi /etc/rc.d/init.d/xfs
...{备注:一些资料说Unix默认是 -1,最好强制指定为 7100 断绝隐患}
<-----
daemon xfs -droppriv -daemon -port 7100
----->
![]()
vi /etc/X11/fs/config
...{备注:默认是关闭 TCP,要用时在 no-listen 前面加注解号,重启}
<-----
# don't listen to TCP ports by default for security reasons
# no-listen = tcp
----->
![]()
netstat -na | grep :7100
lsof -P | grep -e *:7100
![]()
xfsinfo -server 192.168.100.60:7100
<-----
name of server: 192.168.100.60:7100
version number: 2
vendor string: The XFree86 Project (experimental version)
vendor release number: 6600
maximum request size: 8192 longwords (32768 bytes)
number of catalogues: 1
all
Number of alternate servers: 0
number of extensions: 0
----->
![]()
vi /etc/X11/XF86Config
<-----
RgbPath "/usr/X11R6/lib/X11/rgb"
FontPath "/usr/share/fonts/zh_CN/TrueType"
FontPath "/usr/X11R6/lib/X11/fonts/ttf-zh"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi"
FontPath "/usr/X11R6/lib/X11/fonts/misc"
FontPath "/usr/X11R6/lib/X11/fonts/CID"
FontPath "/usr/X11R6/lib/X11/fonts/Speedo"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi"
FontPath "unix/:7100"
FontPath "tcp/192.168.100.60:7100"
----->
| 第1页: 方案概述 | 第2页: 过程分析:TLC字库 |
| 第3页: 基于XDMCP的远程X | 第4页: 安装抓图 |