美文网首页
centos7 系统初始化

centos7 系统初始化

作者: 李哈哈_2c85 | 来源:发表于2023-05-25 18:05 被阅读0次
#!/bin/bash
# centos7 系统初始化
yum install -y rsync lrzsz* vim telnet ntpdate wget net-tools sysstat
chmod +x /etc/rc.d/rc.local
#修改时区
mv /etc/localtime /etc/localtime.bak && cp -a /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
#添加同步时间计划任务
(echo "*/10 * * * * /usr/sbin/ntpdate time.windows.com";crontab -l)|crontab
#关闭25号端口
systemctl stop postfix && systemctl disable postfix
#关闭防火墙-swap分区-selinux
swapoff -a;sed -i 's/.*swap.*/#&/' /etc/fstab
setenforce 0 && sed -i 's/SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
systemctl disable firewalld.service
systemctl stop firewalld.service
#修改系统参数、文件描述符
sed -i 's/4096/65535/' /etc/security/limits.d/20-nproc.conf
echo '* soft nofile 65535' >> /etc/security/limits.conf
echo '* hard nofile 65535' >> /etc/security/limits.conf
echo "ulimit revamped: `ulimit -n`"

相关文章

网友评论

      本文标题:centos7 系统初始化

      本文链接:https://www.haomeiwen.com/subject/bqarirtx.html