centos 7.8 优化 (只是部分后期会再添加)

18 篇文章 0 订阅
4 篇文章 0 订阅

1.    配置代理 (不通过代理上网请忽略)
echo export http_proxy=http://x.x.x.x:8080 >> /etc/profile
source /etc/profile
echo proxy=http://x.x.x.x:8080 >> /etc/yum.conf

2.    关闭防火墙
systemctl stop firewalld
systemctl disable firewalld

3.    安装wget 配置代理
yum install wget -y
sed 's|#https_proxy = http://proxy.yoyodyne.com:18023/|https_proxy = http://x.x.x.x:8080/|g' /etc/wgetrc -i
sed 's|#http_proxy = http://proxy.yoyodyne.com:18023/|http_proxy = http://x.x.x.x:8080/|g' /etc/wgetrc -i
sed 's|#ftp_proxy = http://proxy.yoyodyne.com:18023/|ftp_proxy = http://x.x.x.x:8080/|g' /etc/wgetrc -i
sed 's|#use_proxy = on|use_proxy = on|g' /etc/wgetrc -i
cat /etc/wgetrc |grep _proxy
4.    更换yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

yum clean all
yum makecache
5. 更改网卡名字
vim /etc/default/grub
增加 net.ifnames=0 biosdevname=0 在GRUB_CMDLINE_LI
grub2-mkconfig -o /boot/grub2/grub.cfg
cd /etc/sysconfig/network-scripts/
mv ifcfg-ens32 ifcfg-eth0

sed s#ens32#eth0#g ifcfg-eth0 -i
6. 更改主机名
hostnamectl set-hostname hdss7-2.host.com
hostname
7.关闭selinux
sed s#SELINUX=enforcing#SELINUX=disabled#g /etc/selinux/config  -i

8.关闭usedns 加速ssh登录
sed 's@#UseDNS yes@UseDNS no@g' /etc/ssh/sshd_config -i
systemctl restart sshd

9.安装必要的软件工具
 yum install  lrzsz sysstat  vim  unzip dos2unix nc lsof  wget net-tools telnet tree nmap sysstat   bind-utils -y


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值