feat: 增加创建ssh公钥目录

This commit is contained in:
Olia Lisa
2026-07-12 21:51:05 +08:00
parent 82813ea218
commit a408db2cc5
@@ -20,8 +20,13 @@ if [ -f "$SSHD_CONF" ]; then
else
echo "PasswordAuthentication yes" >> "$SSHD_CONF"
fi
# 创建root用户ssh公钥目录和文件
mkdir -p /root/.ssh
touch /root/.ssh/authorized_keys
fi
# 重启 OpenSSH 服务(如果已安装)
if [ -x /etc/init.d/sshd ]; then
/etc/init.d/sshd enable