0

Im searching for a way to make my openstack create/set a instance with specific user that have specific password

for example i want to provision an instance that will have specific user ( lets say bobi ) who will have password ( lets say bobi123 ).

and when instance is finishing setting up, and it is running i can log from console with a user bobi and pass bobi123

is this possible?

2 Answers2

0

What you're looking for is cloud-init. During instance creation your user-data is injected by the openstack metadata service (neutron) with all your required users, passwords, etc. You need to make sure that your base image has the cloud-init services enabled so they'll start during boot and can contact the metadata service.

eblock
  • 417
  • 2
  • 6
  • i will check that and i will write you back with some updates after i test this :) – Philip Scot Apr 05 '22 at 10:30
  • ok, so there is no way to make a user and passowrd to that user from Horison :/ I manage to make it work with user_data file with both methods ( cloud init and detachable drive (there is a property in server create command) ) And basically i need to create a new site with fields for username and password which need to be translated to file and than script should run server create command with this file :/ also retreive password does not retreive the password you enter :/ O and better crypt the password with some tool because you can see it from metadata or mounting the CD Drive :D – Philip Scot Apr 23 '22 at 08:32
  • You can also provide the user-data in Horizon when creating an instance. – eblock Apr 23 '22 at 12:25
  • True. But the user need to write a _script_ him self on the creation of the instance :) – Philip Scot Apr 23 '22 at 21:45
0

Here is a script you could use to set default passwords and enable SSH password authentication.

#cloud-config
chpasswd:
 list: |
   root:stackops
   ubuntu:stackops
 expire: False
ssh_pwauth: True
idontknow
  • 101
  • 2