0.linux的基础优化

2021-05-14 分类:Linux基础 阅读(225) 评论(0)

孙富阳, 江湖人称没人称。多年互联网运维工作经验,曾负责过孙布斯大规模集群架构自动化运维管理工作。擅长Web集群架构与自动化运维,曾负责国内某大型博客网站运维工作。

1.网卡名称修改

在安装后 centos页面按上下键选择,然后按 tab键 输入几个空格后加入 net.ifnames=0 biosdevname=0

2.系统安全优化,关闭防火墙,关闭selinux

systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i '7s#enforcing#disabled#g' /etc/selinux/config

3.下载源优化

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

4.安装常用工具

yum install -y tree vim wget bash-completion bash-completion-extras lrzsz net-tools sysstat iotop iftop htop unzip nc nmap telnet bc psmisc httpd-tools bind-utils nethogs

5.远程连接优化

sed -i '79d;115d' /etc/ssh/sshd_config 
sed -ri '$aGSSAPIAuthentication no\nUseDNS no' /etc/ssh/sshd_config
systemctl restart sshd

6.时间同步优化

crontab -e
*/2 * * * * /sbin/ntpdate ntp1.aliyun.com &>/dev/null

7.优化命令提示符

vi /etc/profile 
PS1="[\[\e[34;1m\]\u@\[\e[0m\]\[\e[32;1m\]\H\[\e[0m\]\[\e[31;1m\] \w\[\e[0m\]]\\$

评论已关闭

登录

忘记密码 ?

切换登录

注册

鲁ICP备2021019243号-1