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:~ #