centos7系统优化--(Linux运维01)

1.网络的配置,添加网卡

可以手动的在vmware的配置中添加网卡
在这里插入图片描述
然后选择lang区段配置内网网关
在这里插入图片描述
新增网卡的名称路径:

 vim /etc/sysconfig/network-scripts/ifcfg-eth1

可以通过nmtui命令进行编辑:

nmtui

图形画的界面
没有界面检查NetManger服务是否启动
systemctl status NetManger
systemctl start NetManger

内网只需要配置IP即可

也可以在虚拟机的内部进行配置网卡,具体的步骤可以搜索其他博客

2.hosts文件的配置

vim /etc/hosts

172.16.1.5      lb01
172.16.1.6      lb02

添加主机ip 与主机名称的对应

3.更改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  

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

查看yum源信息

yum repolist

4.关闭selinux

sed -i.bak 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
grep SELINUX=disabled /etc/selinux/config 
setenforce 0
getenforce

5.关闭防火墙

关闭
systemctl stop firewalld

开机自启关闭
systemctl disable firewalld

查看防火墙的状态
systemctl status  firewalld

6.英文字符集

 localectl set-locale LANG="en_US.UTF-8"

7.时间同步

yum install -y ntpdate

echo '#time sync by lidao at 2017-03-08' >>/var/spool/cron/root

echo '*/5 * * * * /usr/sbin/ntpdate ntp1.aliyun.com >/dev/null 2>&1' >>/var/spool/cron/root

crontab -l

8.加大文件描述

yum install -y lsof

lsof -i:22

 echo '*               -       nofile          65536' >>/etc/security/limits.conf 
 
 tail -1 /etc/security/limits.conf

9.安装其他的小软件


yum install lrzsz nmap tree dos2unix nc telnet wget lsof ntpdate bash-completion bash-completion-extras -y 
      

10.ssh连接速度慢

修改配置文件
sed -i.bak 's@#UseDNS yes@UseDNS no@g;s@^GSSAPIAuthentication yes@GSSAPIAuthentication no@g'  /etc/ssh/sshd_config

重启ssh服务
systemctl restart sshd	
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

长安有故里y

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值