Skip to content

时间同步 ​

timedatectl
System clock synchronizedNTP service怎么办
yes随便跳过
noinactive 或 n/a执行下面这条命令,一两分钟后再看
noactive已有对时服务,等几分钟再看;十分钟后还是 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) '