以下内容应该在服务器系统安装完成后进行检查。
必备软件包
Debian 系列:
更新索引并升级软件包:
$ sudo apt update && sudo apt upgrade -y
安装系统管理工具:
$ sudo apt install -y htop glances tmux screen lsof strace dstat sysstat ncdu tree
安装网络工具:
$ sudo apt install -y iproute2 net-tools curl wget nmap traceroute mtr iperf3 tcpdump dnsutils
安装监控与日志工具:
$ sudo apt install -y logrotate goaccess
安装安全相关工具:
$ sudo apt install -y ufw fail2ban auditd iptables nftables
安装文本和压缩工具:
$ sudo apt install -y rsync vim pv tar gzip xz-utils zip unzip findutils grep sed
安装版本控制和自动化工具:
$ sudo apt install -y git cron ansible
CentOS 系列:
更新索引并升级软件包:
$ sudo yum update -y
安装系统管理工具:
$ sudo yum install -y htop tmux screen lsof strace sysstat ncdu tree
安装网络工具:
$ sudo yum install -y iproute net-tools curl wget nmap traceroute mtr iperf3 tcpdump bind-utils
安装监控与日志工具
$ sudo yum install -y logrotate
安装安全相关工具
$ sudo yum install -y firewalld audit sudo iptables-services nftables
安装文本和压缩工具
$ sudo yum install -y vim rsync pv tar gzip xz zip unzip findutils grep sed gawk
安装版本控制和自动化工具
$ sudo yum install -y git cronie ansible
配置 SSH 客户端保持在线
修改
/etc/ssh/sshd_config
中内容ClientAliveInterval 0 ClientAliveCountMax 0
并执行
$ sudo systemctl restart sshd
配置 SSH 免密
方法一、通过
ssh-copy-id
添加免密公钥方法二、将公钥内容加入到
root
账号的.ssh/authorized_keys
文件中启用 sshd 服务
$ sudo systemctl enable sshd --now