时间同步
timedatectl| System clock synchronized | NTP service | 怎么办 |
|---|---|---|
yes | 随便 | 跳过 |
no | inactive 或 n/a | 执行下面这条命令,一两分钟后再看 |
no | active | 已有对时服务,等几分钟再看;十分钟后还是 no 就停下来问 |
apt install -y systemd-timesyncd && systemctl enable --now systemd-timesyncd修改 SSH 端口 / 只允许密钥登录
放公钥。
mkdir -p ~/.ssh && chmod 700 ~/.ssh
nano ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys写入设置
cat > /etc/ssh/sshd_config.d/00-akastr.conf <<'EOF'
Port 新端口
PubkeyAuthentication yes
PasswordAuthentication no
KbdInteractiveAuthentication no
EOF
sshd -t && systemctl restart ssh核对实际生效的设置:
sshd -T | grep -E '^(port|passwordauthentication|pubkeyauthentication|kbdinteractiveauthentication) '