feat: 增加创建ssh公钥目录
This commit is contained in:
@@ -20,8 +20,13 @@ if [ -f "$SSHD_CONF" ]; then
|
|||||||
else
|
else
|
||||||
echo "PasswordAuthentication yes" >> "$SSHD_CONF"
|
echo "PasswordAuthentication yes" >> "$SSHD_CONF"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 创建root用户ssh公钥目录和文件
|
||||||
|
mkdir -p /root/.ssh
|
||||||
|
touch /root/.ssh/authorized_keys
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# 重启 OpenSSH 服务(如果已安装)
|
# 重启 OpenSSH 服务(如果已安装)
|
||||||
if [ -x /etc/init.d/sshd ]; then
|
if [ -x /etc/init.d/sshd ]; then
|
||||||
/etc/init.d/sshd enable
|
/etc/init.d/sshd enable
|
||||||
|
|||||||
Reference in New Issue
Block a user