总所周知,外国人的镜像往往需要以密钥进行ssh登录。
如果想调整为ssh密码登录,甚至是直接在openstack的控制台上登录,在创建实例时配置对应的脚本即可。
镜像来源
http://cloud.centos.org/centos/7/images/
创建实例
在创建实例时候,加入对应脚本。
加入脚本
#!/bin/sh
sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
cp -f /home/centos/.ssh/authorized_keys /root/.ssh/
service sshd restart
passwd root<<EOF
password
password
EOF