7 月 032014
 

nagios-path

nagios-web-url

修改
[root@monitor share]# pwd
/usr/local/nagios/share
[root@monitor share]# vi config.inc.php

//$cfg[‘cgi_base_url’]=’/nagios/cgi-bin’;
$cfg[‘cgi_base_url’]=’/monitor2/cgi-bin’;

修改
[root@monitor etc]# pwd
/usr/local/nagios/etc
[root@monitor etc]# vi cgi.cfg
# URL HTML PATH
# This is the path portion of the URL that corresponds to the
# physical location of the Nagios HTML files (as defined above).
# This value is used by the CGIs to locate the online documentation
# and graphics. If you access the Nagios pages with an URL like
# http://www.myhost.com/nagios, this value should be ‘/nagios’
# (without the quotes).

#url_html_path=/nagios
url_html_path=/monitor2

修改
[root@monitor conf.d]# pwd
/etc/httpd/conf.d
[root@monitor conf.d]# vi nagios.conf

#ScriptAlias /nagios/cgi-bin “/usr/local/nagios/sbin”
ScriptAlias /monitor2/cgi-bin “/usr/local/nagios/sbin”

#Alias /nagios “/usr/local/nagios/share”
Alias /monitor2 “/usr/local/nagios/share”

重启
[root@monitor share]# service nagios restart
Running configuration check…done.
Stopping nagios: done.
Starting nagios:This account is currently not available.
done.
[root@monitor share]#

[root@monitor etc]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@monitor etc]#

7 月 012014
 

[root@AY1405192126447871b3Z ~]# tracepath 128.199.159.18
1: 182.92.x.xx (182.92.x.xx) 0.151ms pmtu 1500
1: 182.92.3.249 (182.92.3.249) 0.564ms
1: 182.92.3.249 (182.92.3.249) 0.468ms
2: 10.106.128.58 (10.106.128.58) 0.481ms
3: 10.255.32.90 (10.255.32.90) 0.562ms
4: no reply
5: 202.106.35.189 (202.106.35.189) 4.804ms
6: 61.148.153.50 (61.148.153.50) 2.497ms asymm 5
7: 202.96.12.5 (202.96.12.5) 5.612ms asymm 6
8: 219.158.3.234 (219.158.3.234) 24.226ms
9: 219.158.3.234 (219.158.3.234) 24.742ms asymm 8
10: 219.158.38.98 (219.158.38.98) 182.474ms asymm 11
11: 219.158.38.98 (219.158.38.98) 180.924ms
12: ae-19.r24.tokyjp05.jp.bb.gin.ntt.net (129.250.6.209) 190.888ms asymm 11
13: ae-1.r00.sngpsi02.sg.bb.gin.ntt.net (129.250.4.143) 238.101ms
14: 116.51.27.190 (116.51.27.190) 256.508ms asymm 15
15: 103.253.144.242 (103.253.144.242) 225.248ms
16: 103.253.144.242 (103.253.144.242) 239.151ms
17: oversea.nsnsc.net (128.199.159.18) 177.068ms !H
Resume: pmtu 1500
[root@AY1405192126447871b3Z ~]# ping -c 8 128.199.159.18
PING 128.199.159.18 (128.199.159.18) 56(84) bytes of data.
64 bytes from 128.199.159.18: icmp_seq=1 ttl=50 time=183 ms
64 bytes from 128.199.159.18: icmp_seq=2 ttl=50 time=182 ms
64 bytes from 128.199.159.18: icmp_seq=3 ttl=49 time=201 ms
64 bytes from 128.199.159.18: icmp_seq=4 ttl=49 time=183 ms
64 bytes from 128.199.159.18: icmp_seq=5 ttl=49 time=182 ms
64 bytes from 128.199.159.18: icmp_seq=6 ttl=50 time=162 ms
64 bytes from 128.199.159.18: icmp_seq=7 ttl=50 time=163 ms
64 bytes from 128.199.159.18: icmp_seq=8 ttl=49 time=184 ms

— 128.199.159.18 ping statistics —
8 packets transmitted, 8 received, 0% packet loss, time 7193ms
rtt min/avg/max/mdev = 162.918/180.516/201.810/11.699 ms
[root@AY1405192126447871b3Z ~]#

 

linux-7zyd:~ # tracepath 128.199.159.18
1: 192.168.1.254 6.348ms
2: 14.155.200.1 10.473ms
3: 113.106.37.5 10.830ms
4: 59.40.49.90 16.639ms
5: 119.145.47.94 18.891ms
6: 202.97.33.166 13.671ms
7: 202.97.61.242 16.106ms
8: 202.97.60.18 14.889ms
9: p16-5-3-3.r23.tokyjp01.jp.bb.gin.ntt.net 111.986ms asymm 10
10: as-1.r20.sngpsi02.sg.bb.gin.ntt.net 178.717ms
11: ae-6.r00.sngpsi02.sg.bb.gin.ntt.net 181.077ms asymm 12
12: 116.51.27.190 222.487ms asymm 13
13: 103.253.144.242 214.349ms asymm 14
14: oversea.nsnsc.net 105.420ms !H
Resume: pmtu 65535
linux-7zyd:~ # ping -c 8 128.199.159.18
PING 128.199.159.18 (128.199.159.18) 56(84) bytes of data.
64 bytes from 128.199.159.18: icmp_seq=1 ttl=52 time=87.7 ms
64 bytes from 128.199.159.18: icmp_seq=2 ttl=52 time=85.1 ms
64 bytes from 128.199.159.18: icmp_seq=3 ttl=52 time=86.4 ms
64 bytes from 128.199.159.18: icmp_seq=4 ttl=52 time=88.4 ms
64 bytes from 128.199.159.18: icmp_seq=5 ttl=52 time=89.0 ms
64 bytes from 128.199.159.18: icmp_seq=6 ttl=52 time=84.4 ms
64 bytes from 128.199.159.18: icmp_seq=7 ttl=52 time=85.6 ms
64 bytes from 128.199.159.18: icmp_seq=8 ttl=52 time=86.8 ms

— 128.199.159.18 ping statistics —
8 packets transmitted, 8 received, 0% packet loss, time 7007ms
rtt min/avg/max/mdev = 84.419/86.712/89.041/1.559 ms
linux-7zyd:~ #

7 月 012014
 

 

[root@cp conf]# nginx -t
nginx: [emerg] SSL_CTX_use_PrivateKey_file(“/usr/local/nginx/conf/cert.key”) failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
[root@cp conf]#
2014/06/30 10:13:19 [emerg] 28226#0: SSL_CTX_use_PrivateKey_file(“/usr/local/nginx/conf/cert.key”) failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)
比较私钥和证书公钥部分的值

[root@cp conf]# openssl x509 -noout -text -in cert.crt
Modulus:
00:92:2d:90:80:5c:94:ec:67:f1:b9:ee:e2:02:a4:
4d:d2:8a:f3:3f:63:4f:68:ee:a4:63:8f:10:f5:68:
4d:07:b5:40:6e:f0:9c:72:c5:06:78:ef:fe:d6:32:
b3:e6:47:26:d9:46:83:f0:f8:7b:6f:31:a8:a8:6d:
f7:06:5f:0c:11:7f:91:17:ad:f0:57:89:6e:3c:87:
28:f0:e2:84:9c:fc:c0:f3:ea:99:af:44:18:e8:3e:
dc:c0:4c:24:9c:66:a4:7b:72:a0:d6:53:ac:f6:0f:
99:19:bb:26:b9:c4:7c:e1:d4:a1:8e:18:0c:e5:fc:
2e:76:51:cf:c8:62:b4:cb:8b:a9:dc:c4:4e:0b:1f:
ac:e7:66:ab:ae:36:81:db:76:68:c1:d9:63:ae:b0:
48:ff:06:2f:e2:1b:20:72:45:b6:21:38:c3:37:e0:
4d:c0:d7:76:e4:95:8b:d5:8e:d6:66:a7:48:dd:9b:
43:a5:c0:15:98:5a:0b:b4:60:21:7e:ec:89:5e:ff:
3d:5e:bf:ff:19:cf:1c:9d:1c:fa:6d:d4:ff:0c:f1:
ee:e6:de:c2:10:52:d0:af:d9:07:bd:7f:4e:88:6c:
81:13:34:45:d9:16:5c:2b:e8:d2:30:b2:ce:44:f9:
9e:b5:aa:52:e1:69:62:68:d4:56:64:33:f1:e7:5f:
d3:79
Exponent: 65537 (0x10001)
[root@cp conf]# openssl rsa -noout -text -in cert.key
Private-Key: (2048 bit)
modulus:
00:ad:cc:8c:99:c0:9a:d9:43:42:2f:4c:a2:fa:30:
5d:61:a6:0d:cb:ca:67:21:f3:7f:96:81:10:c9:5e:
77:22:41:18:ed:8e:6a:89:1e:c6:06:d0:11:d9:c4:
c0:5b:f6:66:1c:2d:30:45:33:ec:80:7b:10:a5:97:
89:c2:d7:aa:89:73:a9:83:d6:ec:a1:d8:3f:fb:09:
12:76:ad:2a:78:72:de:fb:ec:45:72:ca:c9:09:7e:
35:5b:d5:4e:45:9c:93:43:69:cd:1d:65:11:04:b6:
d9:b4:6a:ef:4c:76:59:71:64:ce:06:17:70:cb:ad:
09:b3:59:73:75:9d:64:d0:b9:a2:fd:02:59:10:ba:
c6:38:1b:d4:11:e6:12:1d:f0:1b:2e:07:e3:af:f4:
f6:f7:49:89:9d:f3:20:47:64:29:10:05:64:c2:28:
ed:fa:15:20:b0:0e:c0:c0:df:0d:3f:cd:fe:4f:e1:
09:e3:73:25:79:d2:d9:c7:b3:f9:97:57:fa:3b:78:
1a:ae:d6:0f:2e:3f:a4:d3:17:d1:95:0d:1f:30:e7:
9c:f6:19:cf:1a:0a:60:5b:5b:0d:ed:27:a5:51:67:
ae:37:4e:a7:cd:e7:01:d5:b3:a1:28:a7:1a:bf:92:
27:7f:ad:11:08:d4:34:21:24:54:66:83:44:97:17:
2f:cb
publicExponent: 65537 (0x10001)
使用相同的CSR重新签发证书

[root@AY1405192126447871b3Z 17858]# openssl x509 -noout -text -in cert.crt
Modulus:
00:ad:cc:8c:99:c0:9a:d9:43:42:2f:4c:a2:fa:30:
5d:61:a6:0d:cb:ca:67:21:f3:7f:96:81:10:c9:5e:
77:22:41:18:ed:8e:6a:89:1e:c6:06:d0:11:d9:c4:
c0:5b:f6:66:1c:2d:30:45:33:ec:80:7b:10:a5:97:
89:c2:d7:aa:89:73:a9:83:d6:ec:a1:d8:3f:fb:09:
12:76:ad:2a:78:72:de:fb:ec:45:72:ca:c9:09:7e:
35:5b:d5:4e:45:9c:93:43:69:cd:1d:65:11:04:b6:
d9:b4:6a:ef:4c:76:59:71:64:ce:06:17:70:cb:ad:
09:b3:59:73:75:9d:64:d0:b9:a2:fd:02:59:10:ba:
c6:38:1b:d4:11:e6:12:1d:f0:1b:2e:07:e3:af:f4:
f6:f7:49:89:9d:f3:20:47:64:29:10:05:64:c2:28:
ed:fa:15:20:b0:0e:c0:c0:df:0d:3f:cd:fe:4f:e1:
09:e3:73:25:79:d2:d9:c7:b3:f9:97:57:fa:3b:78:
1a:ae:d6:0f:2e:3f:a4:d3:17:d1:95:0d:1f:30:e7:
9c:f6:19:cf:1a:0a:60:5b:5b:0d:ed:27:a5:51:67:
ae:37:4e:a7:cd:e7:01:d5:b3:a1:28:a7:1a:bf:92:
27:7f:ad:11:08:d4:34:21:24:54:66:83:44:97:17:
2f:cb
Exponent: 65537 (0x10001)
[root@AY1405192126447871b3Z 17858]# openssl rsa -noout -text -in cert.key
Private-Key: (2048 bit)
modulus:
00:ad:cc:8c:99:c0:9a:d9:43:42:2f:4c:a2:fa:30:
5d:61:a6:0d:cb:ca:67:21:f3:7f:96:81:10:c9:5e:
77:22:41:18:ed:8e:6a:89:1e:c6:06:d0:11:d9:c4:
c0:5b:f6:66:1c:2d:30:45:33:ec:80:7b:10:a5:97:
89:c2:d7:aa:89:73:a9:83:d6:ec:a1:d8:3f:fb:09:
12:76:ad:2a:78:72:de:fb:ec:45:72:ca:c9:09:7e:
35:5b:d5:4e:45:9c:93:43:69:cd:1d:65:11:04:b6:
d9:b4:6a:ef:4c:76:59:71:64:ce:06:17:70:cb:ad:
09:b3:59:73:75:9d:64:d0:b9:a2:fd:02:59:10:ba:
c6:38:1b:d4:11:e6:12:1d:f0:1b:2e:07:e3:af:f4:
f6:f7:49:89:9d:f3:20:47:64:29:10:05:64:c2:28:
ed:fa:15:20:b0:0e:c0:c0:df:0d:3f:cd:fe:4f:e1:
09:e3:73:25:79:d2:d9:c7:b3:f9:97:57:fa:3b:78:
1a:ae:d6:0f:2e:3f:a4:d3:17:d1:95:0d:1f:30:e7:
9c:f6:19:cf:1a:0a:60:5b:5b:0d:ed:27:a5:51:67:
ae:37:4e:a7:cd:e7:01:d5:b3:a1:28:a7:1a:bf:92:
27:7f:ad:11:08:d4:34:21:24:54:66:83:44:97:17:
2f:cb
publicExponent: 65537 (0x10001)

重新检查nginx配置,重新加载配置并查看443端口监听
[root@cp conf]# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@cp conf]# nginx -s reload
[root@cp conf]# netstat -ltn |grep 443
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN
[root@cp conf]#

 

6 月 272014
 

http://www.ioncube.com/loaders.php
http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz

http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

[ionCube Loader]
zend_extension=”/usr/local/ioncube/ioncube_loader_lin_5.3.so”

[root@cp ~]# php -v
PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v4.6.1, Copyright (c) 2002-2014, by ionCube Ltd.
[root@cp ~]#

6 月 262014
 

最小化安装系统后查看系统默认软件源列表

linux-o2qn:~ # zypper repos
 # | Alias | Name | Enabled | Refresh
 --+---------------------------+------------------------------------+---------+--------
 1 | openSUSE-13.1-1.10 | openSUSE-13.1-1.10 | Yes | No
 2 | repo-debug | openSUSE-13.1-Debug | No | Yes
 3 | repo-debug-update | openSUSE-13.1-Update-Debug | No | Yes
 4 | repo-debug-update-non-oss | openSUSE-13.1-Update-Debug-Non-Oss | No | Yes
 5 | repo-non-oss | openSUSE-13.1-Non-Oss | Yes | Yes
 6 | repo-oss | openSUSE-13.1-Oss | Yes | Yes
 7 | repo-source | openSUSE-13.1-Source | No | Yes
 8 | repo-update | openSUSE-13.1-Update | Yes | Yes
 9 | repo-update-non-oss | openSUSE-13.1-Update-Non-Oss | Yes | Yes
 linux-o2qn:~ #

删除安装系统时生成的安装光盘软件源后重新查看源列表

linux-o2qn:~ # zypper removerepo openSUSE-13.1-1.10
 Removing repository 'openSUSE-13.1-1.10' ..........................................................[done]
 Repository 'openSUSE-13.1-1.10' has been removed.
 linux-o2qn:~ # zypper repos
 # | Alias | Name | Enabled | Refresh
 --+---------------------------+------------------------------------+---------+--------
 1 | repo-debug | openSUSE-13.1-Debug | No | Yes
 2 | repo-debug-update | openSUSE-13.1-Update-Debug | No | Yes
 3 | repo-debug-update-non-oss | openSUSE-13.1-Update-Debug-Non-Oss | No | Yes
 4 | repo-non-oss | openSUSE-13.1-Non-Oss | Yes | Yes
 5 | repo-oss | openSUSE-13.1-Oss | Yes | Yes
 6 | repo-source | openSUSE-13.1-Source | No | Yes
 7 | repo-update | openSUSE-13.1-Update | Yes | Yes
 8 | repo-update-non-oss | openSUSE-13.1-Update-Non-Oss | Yes | Yes
 linux-o2qn:~ #

删除软件源配置时同时也删除了目录中的配置文件

linux-o2qn:~ # ls /etc/zypp/repos.d/
 repo-debug.repo repo-debug-update.repo repo-oss.repo repo-update-non-oss.repo
 repo-debug-update-non-oss.repo repo-non-oss.repo repo-source.repo repo-update.repo
 linux-o2qn:~ #
 linux-o2qn:~ # zypper rr repo-oss repo-non-oss repo-update repo-update-non-oss
 Removing repository 'openSUSE-13.1-Non-Oss' .......................................................[done]
 Repository 'openSUSE-13.1-Non-Oss' has been removed.
 Removing repository 'openSUSE-13.1-Oss' ...........................................................[done]
 Repository 'openSUSE-13.1-Oss' has been removed.
 Removing repository 'openSUSE-13.1-Update' ........................................................[done]
 Repository 'openSUSE-13.1-Update' has been removed.
 Removing repository 'openSUSE-13.1-Update-Non-Oss' ................................................[done]
 Repository 'openSUSE-13.1-Update-Non-Oss' has been removed.
 linux-o2qn:~ # ls /etc/zypp/repos.d/
 repo-debug.repo repo-debug-update-non-oss.repo repo-debug-update.repo repo-source.repo
 linux-o2qn:~ #

添加阿里云软件源,可以提高访问和下载速度
linux-o2qn:~ # zypper addrepo -f http://mirrors.aliyun.com/opensuse/distribution/13.1/repo/oss/ openSUSE-13.1-Oss
Adding repository ‘openSUSE-13.1-Oss’ …………………………………………………….[done]
Repository ‘openSUSE-13.1-Oss’ successfully added
Enabled: Yes
Autorefresh: Yes
GPG check: Yes
URI: http://mirrors.aliyun.com/opensuse/distribution/13.1/repo/oss/

linux-o2qn:~ # zypper addrepo -f http://mirrors.aliyun.com/opensuse/distribution/13.1/repo/non-oss/ openSUSE-13.1-Non-Oss
Adding repository ‘openSUSE-13.1-Non-Oss’ …………………………………………………[done]
Repository ‘openSUSE-13.1-Non-Oss’ successfully added
Enabled: Yes
Autorefresh: Yes
GPG check: Yes
URI: http://mirrors.aliyun.com/opensuse/distribution/13.1/repo/non-oss/

linux-o2qn:~ # zypper repos
# | Alias | Name | Enabled | Refresh
–+—————————+————————————+———+——–
1 | openSUSE-13.1-Non-Oss | openSUSE-13.1-Non-Oss | Yes | Yes
2 | openSUSE-13.1-Oss | openSUSE-13.1-Oss | Yes | Yes
3 | repo-debug | openSUSE-13.1-Debug | No | Yes
4 | repo-debug-update | openSUSE-13.1-Update-Debug | No | Yes
5 | repo-debug-update-non-oss | openSUSE-13.1-Update-Debug-Non-Oss | No | Yes
6 | repo-source | openSUSE-13.1-Source | No | Yes
linux-o2qn:~ #

使用短参数添加软件源
linux-o2qn:~ # zypper ar -f http://mirrors.aliyun.com/opensuse/update/13.1/ openSUSE-13.1-Update-Oss
Adding repository ‘openSUSE-13.1-Update-Oss’ ………………………………………………[done]
Repository ‘openSUSE-13.1-Update-Oss’ successfully added
Enabled: Yes
Autorefresh: Yes
GPG check: Yes
URI: http://mirrors.aliyun.com/opensuse/update/13.1/

linux-o2qn:~ # zypper ar -f http://mirrors.aliyun.com/opensuse/update/13.1-non-oss/ openSUSE-13.1-Update-Non-Oss
Adding repository ‘openSUSE-13.1-Update-Non-Oss’ …………………………………………..[done]
Repository ‘openSUSE-13.1-Update-Non-Oss’ successfully added
Enabled: Yes
Autorefresh: Yes
GPG check: Yes
URI: http://mirrors.aliyun.com/opensuse/update/13.1-non-oss/

linux-o2qn:~ #

更改软件源后执行刷新

linux-o2qn:~ # zypper refresh
 Retrieving repository 'openSUSE-13.1-Non-Oss' metadata ............................................[done]
 Building repository 'openSUSE-13.1-Non-Oss' cache .................................................[done]
 Retrieving repository 'openSUSE-13.1-Oss' metadata ................................................[done]
 Building repository 'openSUSE-13.1-Oss' cache .....................................................[done]
 Retrieving repository 'openSUSE-13.1-Update-Non-Oss' metadata .....................................[done]
 Building repository 'openSUSE-13.1-Update-Non-Oss' cache ..........................................[done]
 Retrieving repository 'openSUSE-13.1-Update-Oss' metadata .........................................[done]
 Building repository 'openSUSE-13.1-Update-Oss' cache ..............................................[done]
 All repositories have been refreshed.
 linux-o2qn:~ #

linux-s4lx:~ # uname -ar
Linux linux-s4lx 3.11.6-4-default #1 SMP Wed Oct 30 18:04:56 UTC 2013 (e6d4a27) x86_64 x86_64 x86_64 GNU/Linux
linux-s4lx:~ # zypper update
Loading repository data…
Reading installed packages…

The following NEW packages are going to be installed:
kernel-default-3.11.10-11.1 keyutils

The following packages are going to be upgraded:
aaa_base aaa_base-extras autofs bind-libs bind-utils ca-certificates ca-certificates-mozilla coreutils
curl dbus-1 dbus-1-x11 file file-magic fontconfig gio-branding-openSUSE glib2-tools glibc glibc-extra
glibc-locale gpg2 grub2 grub2-i386-pc grub2-x86_64-efi iputils kernel-firmware kpartx krb5 less
libblkid1 libcap-ng0 libcurl4 libdbus-1-3 libgio-2_0-0 libglib-2_0-0 libgmodule-2_0-0 libgobject-2_0-0
libgudev-1_0-0 libmagic1 libmount1 libopenssl1_0_0 libparted0 libpng16-16 libprocps1 libpython2_7-1_0
libsolv-tools libstorage4 libstorage-ruby libtirpc1 libudev1 libupower-glib1 libuuid1 libxml2-2
libyaml-0-2 libzypp logrotate lvm2 mdadm mozilla-nspr multipath-tools nfs-client nscd openssh openssl
pam parted pm-utils procps python-base release-notes-openSUSE rpm rsync ruby20 sudo SuSEfirewall2
sysconfig sysconfig-netconfig sysconfig-network systemd systemd-presets-branding-openSUSE
systemd-sysvinit tar udev udevmountd upower util-linux vim yast2 yast2-add-on yast2-ldap-client
yast2-network yast2-ruby-bindings yast2-storage yast2-trans-en_US yast2-ycp-ui-bindings zypper
zypper-aptitude

96 packages to upgrade, 2 new.
Overall download size: 104.6 MiB. After the operation, additional 160.8 MiB will be used.
Continue? [y/n/? shows all options] (y):

 
http://mirrors.sohu.com/opensuse/update/13.1/
http://mirrors.sohu.com/opensuse/update/13.1-non-oss/
http://mirrors.sohu.com/opensuse/distribution/13.1/repo/non-oss/
http://mirrors.sohu.com/opensuse/distribution/13.1/repo/oss

6 月 252014
 

oss-server-minimal-install-00oss-server-minimal-installoss-server-minimal-install-02 oss-server-minimal-install-03 oss-server-minimal-install-04 oss-server-minimal-install-05

查看网卡配置信息,默认为从DHCP自动获得IP地址
linux-o2qn:~ # cat /etc/sysconfig/network/ifcfg-eth0
BOOTPROTO=’dhcp’
BROADCAST=”
ETHTOOL_OPTIONS=”
IPADDR=”
MTU=”
NAME=’Ethernet Card 0′
NETMASK=”
NETWORK=”
REMOTE_IPADDR=”
STARTMODE=’auto’
USERCONTROL=’no’
linux-o2qn:~ #

查看接口IP信息
linux-o2qn:~ # ifconfig
eth0 Link encap:Ethernet HWaddr 52:54:00:23:36:5F
inet addr:192.168.2.233 Bcast:192.168.3.255 Mask:255.255.252.0
inet6 addr: fe80::5054:ff:fe23:365f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:165825 errors:0 dropped:29991 overruns:0 frame:0
TX packets:17858 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:41686835 (39.7 Mb) TX bytes:1926372 (1.8 Mb)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

linux-o2qn:~ #

启动SSHD服务并查看服务运行状态
linux-o2qn:~ # rcsshd start
linux-o2qn:~ # rcsshd status |grep Active
Active: active (running) since Wed 2014-06-25 04:11:16 CST; 1h 23min ago
linux-o2qn:~ #
linux-o2qn:~ # netstat -ltn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 :::22 :::* LISTEN
linux-o2qn:~ #

远程登录SSH无法成功
harveymei@linux-7zyd:~> ssh root@192.168.2.233
ssh: connect to host 192.168.2.233 port 22: Connection timed out
harveymei@linux-7zyd:~>

修改防火墙配置文件,设置允许从外部网络访问的TCP服务端口号或名称
linux-o2qn:~ # vi /etc/sysconfig/SuSEfirewall2
## Type: string
#
# Which TCP services _on the firewall_ should be accessible from
# untrusted networks?
#
# Format: space separated list of ports, port ranges or well known
# service names (see /etc/services)
#
# Examples: “ssh”, “123 514”, “3200:3299”, “ftp 22 telnet 512:514″
#
# Note: this setting has precedence over FW_SERVICES_ACCEPT_*
#
FW_SERVICES_EXT_TCP=””

修改为以下内容
FW_SERVICES_EXT_TCP=”22″
重启防火墙并查看防火墙运行状态
linux-o2qn:~ # rcSuSEfirewall2 restart
linux-o2qn:~ # rcSuSEfirewall2 status
SuSEfirewall2.service – SuSEfirewall2 phase 2
Loaded: loaded (/usr/lib/systemd/system/SuSEfirewall2.service; enabled)
Active: active (exited) since Wed 2014-06-25 03:18:47 HKT; 4s ago
Process: 5562 ExecStop=/usr/sbin/SuSEfirewall2 systemd_stop (code=exited, status=0/SUCCESS)
Process: 5644 ExecStart=/usr/sbin/SuSEfirewall2 boot_setup (code=exited, status=0/SUCCESS)
Main PID: 5644 (code=exited, status=0/SUCCESS)

Jun 25 03:18:47 linux-o2qn systemd[1]: Starting SuSEfirewall2 phase 2…
Jun 25 03:18:47 linux-o2qn SuSEfirewall2[5650]: Setting up rules from /etc/sysconfig/SuSEfirewall2 …
Jun 25 03:18:47 linux-o2qn SuSEfirewall2[5714]: Firewall rules successfully set
Jun 25 03:18:47 linux-o2qn systemd[1]: Started SuSEfirewall2 phase 2.
linux-o2qn:~ #

再次尝试远程登录SSH服务
harveymei@linux-7zyd:~> ssh root@192.168.2.233
Password:
Last login: Wed Jun 25 03:15:37 2014 from 192.168.1.37
Have a lot of fun…
linux-o2qn:~ #