CentOS7安装后初始化配置
时间:2015-11-20 15:46 来源:linux.it.net.cn 作者:IT
#关闭selinux和firewalld,配置网络
getenforce
setenforce 0
vi
/etc/selinux/config
SELINUX=disabled
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
ip add
ifup
ifdown
vi
/etc/sysconfig/network-scripts/ifcfg-eno16777728
BOOTPROTO=static
IPADDR=192.168.1.99
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=192.168.1.100
NM_CONTROLLED=no
echo
'DNS1=192.168.1.100'
>>
/etc/sysconfig/network-script/ifcfg-eno16777728
vi
/var/named/example
.zone
vi
/var/named/192
.168.1.zone
vi
/etc/sysconfig/network
NETWORKING=
yes
HOSTNAME=lin26.example.
local
1
systemctl restart network
mkdir
/etc/yum
.repos.d
/backup
mv
/etc/yum
.repos.d/*.*
/etc/yum
.repos.d
/backup
vi
/etc/yum
.repos.d
/lin01
.repo
[base]
name=lin01
baseurl=http:
//lin01
.example.
local
/cdrom
enable
=1
gpgcheck=1
gpgkey=
file
:
///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
yum clean all
yum update
vi
/etc/yum
.repos.d
/aliyun
.repo
[base]
name=aliyun
baseurl=http:
//mirrors
.aliyun.com
/centos/7/os/x86_64/
enable
=1
gpgcheck=1
gpgkey=
file
:
///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
yum clean all
yum update
tzselect
yum
install
-y ntpdate
#和服务器的时间差不能超过1天
ntpdate -d lin01.example.
local
vi
/etc/crontab
00 *
/1
* * * root
/usr/sbin/ntpdate
lin01.example.
local
;
/sbin/hwclock
-w
date
-s 11
/16/2015
date
-s 18:28:00
hwclock -w
yum
install
-y net-tools
netstat
-ntupl
shutdown
-P
shutdown
-r
shutdown
-c
reboot
sync
(责任编辑:IT)
#关闭selinux和firewalld,配置网络
|