360SDN.COM

Openstack-Ocata 使用官方ubuntu和Centos镜像无法使用ssh用户名密码登录?

来源:  2019-04-19 11:35:06    评论:0点击:

Openstack-Ocata 版 从官网下载镜像,实例安装完成后需要用户名密码,默认用户名密码是什么?

Ubuntu:

#!/bin/sh
passwd ubuntu<<EOF
ubuntu
ubuntu
EOF
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
service ssh restart
#!/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/ubuntu/.ssh/authorized_keys /root/.ssh/    
service ssh restart    
passwd ubuntu<<EOF    
123456  
123456  
EOF

CentOS7

#!/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 centos<<EOF    
123456  
123456  
EOF
为您推荐

友情链接 |九搜汽车网 |手机ok生活信息网|ok生活信息网|ok微生活
 Powered by www.360SDN.COM   京ICP备11022651号-4 © 2012-2016 版权