Ask Your Question
0

Customisation script does not work for defining default user-password for Ubuntu Cloud image

asked 2014-09-09 04:27:12 -0500

Robert gravatar image

updated 2014-09-11 06:12:47 -0500

I have running OpenStack Icehouse on some physical servers. All my work with OpenStack is by dashboard. When a user creates an instance from image Ubuntu 14.04 LTS, user will not be able to login immediately because user does not have password. So when user lunches instance in tab "Post-Creation" and adds script below, it should work but it doesn't. I have been reading about this issue here https://ask.openstack.org/en/question... , but that is not working for my user.

#cloud-config
password: userpaswords
chpasswd: { expire: False }
ssh_pwauth: True

What about what would be solution for my user with ssh key pairs?

edit retag flag offensive close merge delete

Comments

I hate it when others ask the reason for a question, but I'm still going to ..... what's your rational for not wanting to use public/private key authentication? The way it's implemented in Openstack is a doodle.

b.t.w not so much a Openstack as a Cloud-Init question

Remko Duppen gravatar imageRemko Duppen ( 2014-09-09 07:37:37 -0500 )edit

Reason why my script above did not work is that I used tiny flovaor for launcing virtual machine with Ubuntu Server 14.04 LTS. My mistake!

Robert gravatar imageRobert ( 2014-09-11 06:14:29 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2014-09-09 09:34:20 -0500

larsks gravatar image

What about what would be solution for my user with ssh key pairs?

To use ssh-key authentication:

  • Your users need to upload an ssh key to Nova. This can be done on the command line using the nova keypair-add command, or via the dashboard on the Access and Security tab ( http://YOUR_DASHBPARD_HOST/dashboard/... ).

  • When you boot a a server, you need to tell Nova which key to use. On the command line this is the --key-name option, and in the dashboard this is "Key Pair" dropdown on the "Access and Security" tab of the "Launch Instance" dialog.

  • A cloud-init enabled image will then install the public key in the appropriate place for the default user (where the "default user" depends on what you're using...cirros for the Cirros image, ubuntu for Ubuntu, fedora for Fedora, cloud-user for RHEL and CentOS, etc).

  • When the user connects to a server, they need to have ssh configure to use their private key for authentication. If they have used the default ssh key filename (~/.ssh/id_rsa or id_dsa), this should Just Work.

edit flag offensive delete link more

Comments

I now how to use script from first question in horizon. What wolud be instructions for terminal?

Robert gravatar imageRobert ( 2014-09-11 06:12:36 -0500 )edit
1

This answer already has instructions for using the command line; that's why it says things like, "on the command line...". You can find a more complete example here.

larsks gravatar imagelarsks ( 2014-09-11 15:34:41 -0500 )edit
1

Note that the example I just posted generates a new ssh private key for you. If you want to use an existing private, the keypair-add command has a --pub-key option to point it at an existing public key.

larsks gravatar imagelarsks ( 2014-09-11 15:35:34 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-09-09 04:27:12 -0500

Seen: 2,906 times

Last updated: Sep 11 '14