栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

centos7系统优化脚本

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

centos7系统优化脚本

#!/bin/bash
#优化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 wget  &>/dev/null
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

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

#防火墙的关闭
systemctl stop firewalld
systemctl disable firewalld

#同步字符集
localectl set-locale LANG="en_US.UTF-8"

##时间同步
yum install -y ntpdate &>/dev/null
/usr/sbin/ntpdate ntp1.aliyun.com &>/dev/null


yum install vim lrzsz nmap tree dos2unix nc telnet wget lsof ntpdate bash-completion bash-completion-extras net-tools -y  &>/dev/null 
     
#优化ssh修改配置文件
sed -i.bak 's@#UseDNS yes@UseDNS no@g;s@^GSSAPIAuthentication yes@GSSAPIAuthentication no@g'  /etc/ssh/sshd_config
systemctl restart sshd	
	
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/342059.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号