[英]Login password for ubuntu, RHEL, any cloud image
OpenStack cloud Images : OpenStack云映像 :
There are multiple cloud images which are available at https://docs.openstack.org/image-guide/obtain-images.html . 在https://docs.openstack.org/image-guide/obtain-images.html上有多个云映像。 In order to login to the VMs once those are deployed is either by using
ssh key pair
or password
. 为了在VM部署后登录到VM,可以使用
ssh key pair
或password
。 But there are images where the sshkeypairlogin
is disabled and there is no in-built password by default, then how to login to these VMs where the user have only information on the user-name
但是有些映像禁用了
sshkeypairlogin
,默认情况下没有内置密码,然后如何登录到这些VM,其中用户仅拥有有关user-name
There are options to generate the password for the in-built users using cloud-init
: 有一些选项可以使用
cloud-init
为内置用户生成密码:
Option-1 : Using OpenStack horizon 选项1 : 使用OpenStack Horizon
If the user is using horizon to launch the instance then for the post-configuration
by providing the config as: 如果用户使用Horizon启动实例,则通过提供以下配置来进行
post-configuration
:
#cloud-config
chpasswd:
list: |
cloud-user:rhel
root:rheladmin
expire: False
Here the passwords are generated for cloud-user
and root
users of RHEL image. 在此,将为RHEL映像的
cloud-user
和root
用户生成密码。 The same is used for any user of any image simply by replacing the user. 只需替换用户即可对任何图像的任何用户使用相同的功能。
Option-2 : Using OpenStack heat template 选项2 : 使用OpenStack热模板
Using the openstack heat template by providing the user-data
as below: 通过提供以下
user-data
来使用Openstack Heat模板:
heat_template_version: 2015-04-30
description: Launch the RHEL VM with a new password for cloud-user and root user
resources:
rhel_instance:
type: OS::Nova::Server
properties:
name: 'demo_instance'
image: '15548f32-fe27-449b-9c7d-9a113ad33778'
flavor: 'm1.medium'
availability_zone: zone1
key_name: 'key1'
networks:
- network: '731ba722-68ba-4423-9e5a-a7677d5bdd2d'
user_data_format: RAW
user_data: |
#cloud-config
chpasswd:
list: |
cloud-user:rhel
root:rheladmin
expire: False
Here the passwords are generated for cloud-user
and root
users of RHEL image. 在此,将为RHEL映像的
cloud-user
和root
用户生成密码。 The same is used for any user of any image. 相同的用于任何图像的任何用户。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.