創建雲主機使的啟動腳本,如下。該腳本使得我們可以從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