未分类
openstack使用官方镜像
自制镜像很麻烦, 而且坑很多, 之前自建了一个, 导致启不来, 还是直接下载官方的方便好用. 下载官方镜像
1 |
http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1708.qcow2 |
上传镜像:
1 |
glance image-create --name centos-7 --disk-format qcow2 --container-format bare < CentOS-7-x86_64-GenericCloud-1708.qcow2 |
关于使用官方ubuntu镜像无法使用ssh用户名密码登录登录的问题 在创建instance的时候,选择创建后,然后选择直接输入,输入如下代码 ubuntu
1 2 3 4 5 6 7 8 |
#!/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 |
Centos7
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#!/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/ systemctl restart sshd cp -r /usr/share/zoneinfo/Asia/Shanghai /etc/localtime echo "1450" > /sys/class/net/eth0/mtu passwd root<<EOF xxxxxx xxxxxx EOF 注: 密码必须满足8个字符的长度 |