Linux 初始化检查列表2

内网联通

内网的联通需要域名解析(或主机名解析),大的网络可以自己构建DNS服务器,小的网络可以使用 /etc/hosts 替代

添加主机列表到里面

代码语言:javascript
复制
[root@localhost ~]# cat  /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@localhost ~]# 

基础配置

主机名

每台主机最好都配置上主机名以示区别,否则都是 localhost ,敲错命令后果很难估量

只用修改两个地方

  • /etc/hosts
  • /etc/networks
代码语言:javascript
复制
[root@localhost ~]# vim /etc/networks 
[root@localhost ~]# cat /etc/networks 
default 0.0.0.0
loopback 127.0.0.0
link-local 169.254.0.0
HOSTNAME=check-list
[root@localhost ~]#

更新系统

更新系统可以确保打上了新的补丁,使系统更为健壮

使用 yum update 对系统进行更新

代码语言:javascript
复制
[root@localhost ~]# yum update 
Loaded plugins: fastestmirror, security
Setting up Update Process
Loading mirror speeds from cached hostfile
 * base: mirrors.skyshe.cn
 * extras: mirrors.skyshe.cn
 * updates: mirrors.skyshe.cn
base                                                                                | 3.7 kB     00:00     
base/primary_db                                                                     | 4.6 MB     00:04     
extras                                                                              | 3.4 kB     00:00     
extras/primary_db                                                                   |  35 kB     00:00     
updates                                                                             | 3.4 kB     00:00     
updates/primary_db                                                                  | 4.6 MB     00:04     
Resolving Dependencies
--> Running transaction check
---> Package SDL.x86_64 0:1.2.14-6.el6 will be updated
---> Package SDL.x86_64 0:1.2.14-7.el6_7.1 will be an update
...
...
 zip                                   x86_64       3.0-1.el6_7.1                      updates       259 k
Installing for dependencies:
 pcsc-lite-libs                        x86_64       1.5.2-15.el6                       base           28 k

Transaction Summary

Install 2 Package(s)
Upgrade 170 Package(s)

Total download size: 243 M
Is this ok [y/N]: y
Downloading Packages:
(1/172): SDL-1.2.14-7.el6_7.1.x86_64.rpm | 193 kB 00:00
(2/172): bash-4.1.2-33.el6_7.1.x86_64.rpm
...
...
(171/172): udev-147-2.63.el6_7.1.x86_64.rpm | 355 kB 00:00
(172/172): zip-3.0-1.el6_7.1.x86_64.rpm | 259 kB 00:00

Total 1.0 MB/s | 243 MB 04:00
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
Package: centos-release-6-7.el6.centos.12.3.x86_64 (@anaconda-CentOS-201508042137.x86_64/6.7)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : tzdata-java-2016c-1.el6.noarch 1/342
Updating : kernel-firmware-2.6.32-573.22.1.el6.noarch
...
...
tmpwatch.x86_64 0:2.9.16-5.el6_7
tzdata.noarch 0:2016c-1.el6
tzdata-java.noarch 0:2016c-1.el6
udev.x86_64 0:147-2.63.el6_7.1
zip.x86_64 0:3.0-1.el6_7.1

Complete!
[root@localhost ~]# yum update
Loaded plugins: fastestmirror, security
Setting up Update Process
Loading mirror speeds from cached hostfile

  • base: mirrors.skyshe.cn
  • extras: mirrors.skyshe.cn
  • updates: mirrors.skyshe.cn
    No Packages marked for Update
    [root@localhost ~]#