SuPerC

  1. 首页
  2. 技术 and 学习
  3. 正文

CentOS 7基础优化

2017年9月12日 15412点热度 0人点赞 2条评论

新装的系统有不少东西需要优化和安装,通过终端敲命令过于浪费时间,干脆写成一个简单的小脚本供自己以后使用,其中有些配置需要根据环境环境修改。

systemctl disable firewalld
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
rm -rf /etc/yum.repos.d/*
mkdir .ssh && chmod 700 .ssh
curl http://10.0.0.102/authorized_keys > .ssh/authorized_keys && chmod 600 .ssh/authorized_keys
curl http://10.0.0.102/centos7.repo > /etc/yum.repos.d/centos7.repo
curl http://10.0.0.102/epel.repo > /etc/yum.repos.d/epel.repo
curl http://10.0.0.102/resolv.conf > /etc/resolv.conf
curl http://mirrors.ustc.edu.cn/epel/RPM-GPG-KEY-EPEL-7 > /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
curl http://10.0.0.102/ntp.conf > /etc/ntp.conf
curl http://10.0.0.102/hosts > /etc/hosts
yum makecache
yum -y install vim wget lrzsz bmon python-pip net-tools ntp dstat 
yum -y update
systemctl enable ntpd
chmod 777 /etc/rc.d/rc.local
sed -i -e '129s/#/ /g' /etc/ssh/sshd_config
sed -i -e '129s/yes$/no/g' /etc/ssh/sshd_config
sed -i '/^GSS/s/yes/no/g' /etc/ssh/sshd_config
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
timedatectl set-local-rtc 1
clock -w
reboot

这个简陋的小脚本先这样用着,等以后有需求了再慢慢修改、优化。

标签: CentOS 记录
最后更新:2017年12月9日

SuPerC

记录生活,记录自己!

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2024 SuPerC. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang