Centos7 Init

余生长醉 提交于 2020-03-30 01:49:41

shell 常用设置命令

# 关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service

# 替换阿里 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
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
yum makecache

# 安装 vim
yum -y install vim

# 关闭连接 ssh 时的 DNS 查询
sed -i 's/GSSAPIAuthentication yes/GSSAPIAuthentication no/g' /etc/ssh/sshd_config
sed -i 's/#UseDNS yes/UseDNS no/g' /etc/ssh/sshd_config
systemctl restart sshd

# 关闭 selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

# 关闭系统提示音
sed -i 's/#set bell-style none/set bell-style none/g' /etc/inputrc

# 关闭 Vim 提示音
sed -i '$a\setterm –blength 0' ~/.bashrc

end

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!