创建云主机使的启动脚本,如下。该脚本使得我们可以从controller节点无密码登陆到云主机
#!/bin/sh
mv /root/.ssh/authorized_keys /root/.ssh/authorized_keys.old
cp /home/centos/.ssh/authorized_keys /root/.ssh/
下面脚本开启密码登陆云主机
#!/bin/sh
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
systemctl restart sshd
本文介绍如何通过启动脚本实现从controller节点无密码SSH登录到云主机的方法,并提供了开启云主机密码登录的脚本示例。
8045

被折叠的 条评论
为什么被折叠?



