当前位置: 移动技术网 > 科技>操作系统>Linux > centos7 最小安装初始化

centos7 最小安装初始化

2019年03月06日  | 移动技术网科技  | 我要评论

申正焕,教学楼内开涉黄足疗店,对违犯党纪的党组织和党员必须严肃

配置阿里yum源
mv /etc/yum.repos.d/centos-base.repo /etc/yum.repos.d/centos-base.repo.backup \
&&curl -o /etc/yum.repos.d/centos-base.repo http://mirrors.aliyun.com/repo/centos-7.repo
安装常用命令
yum install -y vim lrzsz unzip wget telnet net-tools
关闭防火墙

关闭防火墙

systemctl stop firewalld

关闭自启动

systemctl disable firewalld

关闭selinux,selinux修改为disabled

vim /etc/selinux/config

 配置网络

修改网卡名称格式为ethx

mv ifcfg-ensxxx ifcfg-eth0

编辑网卡配置文件,保留如下配置即可

vim /etc/sysconfig/network-scripts/ifcfg-eth0
device=eth0
onboot=yes
bootproto=dhcp
persistent_dhclient=1
mtu=1492
dns1=114.114.114.114
dns2=8.8.8.8

修改内核参数,通过编辑/etc/default/grub并加入“net.ifnames=0 biosdevname=0 ”到grubcmdlinelinux变量来实现

vim /etc/default/grub
net.ifnames=0 biosdevname=0

运行命令来重新生成grub配置并更新内核参数

grub2-mkconfig -o /boot/grub2/grub.cfg

重启系统

 关闭dns查找 找到usedns yes行,去掉#,修改yes为no
vim /etc/ssh/sshd_config

找到gssapiauthentication yes行,去掉#,修改yes为no

gssapiauthentication no

 安装密码重置脚本
cd \
&&unzip agent.zip \
&&cd /root/cloudresetpwdupdateagent.linux/ \
&&/bin/bash setup.sh \
&&rm –rf agent.zip cloudresetpwd*
 清除hostname 清除hostname,以便根据cloudstack配置的名称命名,编辑network文件
vim /etc/sysconfig/network

仅保留networking=yes

 清除历史使用记录
rm -rf /var/log/btmp \
&&rm -rf /var/log/wtmp \
&&rm -rf /var/log/messages \
&&rm -rf /root/.bash_history \
&&history -c

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网