openstack 初始化镜像账户密码(实际有效)

折腾openstack过程中,下载镜像,启动镜像后,但是使用官方给的默认密码竟然无法登陆,这就尴尬了。

网上有很多教程,因为我使用的最新版本,因为网上很多描述根本无法正常使用,也是折腾了很久,看了很多文档,最后发现以下方案比较有用,特记录下来。


 系统版本:Centos7,openstack Q版。


修改配置文件:/etc/openstack-dashboard/local_settings
OPENSTACK_HYPERVISOR_FEATURES = {
'can_set_mount_point': False,
'can_set_password': True,
'requires_keypair': False,
'enable_quotas': True
}

/etc/nova/nova.conf
[libvirt]
inject_password = true
inject_partition = -1

### 新的版本设置了隐藏,需要打开这两项

LAUNCH_INSTANCE_LEGACY_ENABLED = True
LAUNCH_INSTANCE_NG_ENABLED = True



允许使用root账户登录、密码登录
#!/bin/sh
#sed -i "/PermitRootLogin yes/s/#PermitRootLogin/PermitRootLogin/g" /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
systemctl restart sshd




版权声明:本文为qq_28914007原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。