feat: 增加创建ssh公钥目录
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user