侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130555 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

CentOS系统初始化

2023-09-22 星期五 / 0 评论 / 0 点赞 / 24 阅读 / 1488 字

关闭防火墙,Selinux systemctl stop firewalldsystemctl disable firewalldsetenforce 0sed -i 's/SELINUX=enfor

关闭防火墙,Selinux

systemctl stop firewalldsystemctl disable firewalldsetenforce 0sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

配置yum源

mkdir /etc/yum.repos.d/OldRepomv /etc/yum.repos.d/*.repo /etc/yum.repos.d/OldRepo/curl -so /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repocurl -so /etc/yum.repos.d/Centos-7.repo http://mirrors.aliyun.com/repo/Centos-7.reposed -i '/aliyuncs.com/d' /etc/yum.repos.d/Centos-7.repo /etc/yum.repos.d/epel-7.repo

时间同步

yum install -y ntpdatentpdate ntp1.aliyun.comhwclock -wecho "*/20 * * * * $(which ntpdate) ntp1.aliyun.com > /dev/null 2>&1 && $(which hwclock) -w" > /var/spool/cron/rootchmod 600 /var/spool/cron/root

快速启动

sed -i 's/timeout=.*/timeout=1/g' /boot/grub2/grub.cfg

快速关机

cat <<EOF   >>/etc/systemd/system.confDefaultTimeoutStartSec=15sDefaultTimeoutStopSec=15sEOFsystemctl daemon-reload

资源限制

cat <<EOF  >>/etc/security/limits.conf# add limits* soft nofile 65536* hard nofile 65536* soft nproc 65536* hard nproc 65536* soft  memlock  unlimited* hard memlock  unlimitedEOF

使用脚本

curl https://gitee.com/yx571304/my_oschina/raw/master/init.sh | sh

广告 广告

评论区