How to set ssh key during rebuild?

asked 2013-10-11 20:48:31 -0600

trewq gravatar image

I am using pyrax to automate rebuild a server and set the ssh key during the rebuild process. The key does not get set.

I created my key like so:

with open(os.path.expanduser("~/.ssh/")) as keyfile:

I kick off the rebuild like this:

staging_server.rebuild(ubu_image, password=os.environ['RAX_PASS'], key_name="my_key")

The server gets build but the key does not get set. What do I need to do to pass the key to my linux (ubuntu 12.04) server.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-03-01 10:43:40 -0600

jake-briggs gravatar image

Does your image have cloud-init installed in it? The key is passed via metadata. If cloud-init is not install. Then it will not install the key. Because cloud-init is what reads it from the metadata server and installs it.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2013-10-11 20:48:31 -0600

Seen: 275 times

Last updated: Oct 11 '13