rockylinux 9.3安装后初始优化

rocky linux 初始优化

初始化Rocky Linux系统时,可以执行以下优化步骤:

  1. 更新系统:

    sudo dnf update -y

  2. 安装必要的工具:

    sudo dnf install -y epel-release

    sudo dnf install -y deltarpm

  3. 配置网络(如有需要):

    sudo dnf install -y network-scripts

    sudo nmcli connection modify "Connection Name" ipv4.method manual ipv4.addresses 192.168.1.10/24 ipv4.gateway 192.168.1.1 ipv4.dns "8.8.8.8,8.8.4.4"

    sudo nmcli connection up "Connection Name"

  4. 设置时区(例如设置为上海时区):

    sudo timedatectl set-timezone Asia/Shanghai

  5. 设置语言环境(例如设置为中文):

    sudo localectl set-locale LANG=zh_CN.UTF-8

  6. 创建普通用户并提升权限:

    sudo adduser username

    sudo usermod -aG wheel username

  7. 设置防火墙(如果需要):

    sudo dnf install -y firewalld

    sudo systemctl enable --now firewalld

    sudo firewall-cmd --permanent --add-service=http

    sudo firewall-cmd --reload

  8. 调整文件描述符限制:

    echo "* soft nofile 65535" | sudo tee -a /etc/security/limits.conf

    echo "* hard nofile 65535" | sudo tee -a /etc/security/limits.conf

    echo "* soft nproc 65535" | sudo tee -a /etc/security/limits.conf

    echo "* hard nproc 65535" | sudo tee -a /etc/security/limits.conf

  9. 调整系统服务:

    sudo systemctl disable --now postfix

    sudo dnf install -y s-nail

  10. 清理不必要的模块:

    sudo dnf remove -y xfsprogs

这些步骤提供了一个基本的系统优化框架,可以根据具体需求进行调整。

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值