[ubuntu-cloud] /etc/cloud/cloud.cfg user configuration

Scott Moser smoser at ubuntu.com
Sat Jul 10 02:10:48 BST 2010


On Fri, 9 Jul 2010, Abel Ureta-Vidal wrote:

> Hi,
>
> I'm moving from Ubuntu 8.04 LTS to 10.04 LTS. I'm using the alestic.com 32bits
> image.
> I discovered the new cloud-init package. It is really great to help configure
> our in house
> image. Great work!
>
> Now I'm upgrading our image. We have set up a specific user i.e. 'ensembl'
> that we use to
> ssh in, so I wanted this user to get the EC2 credentials by updating its
> ~/.ssh/authorized_keys.
>
> I found that by changing in /etc/cloud/cloud.cfg
>
> user: ubuntu
>
> to
>
> user: ensembl
>
> it makes the trick, but I'd like to keep the ability to ssh as ubuntu user. I
> tried different syntax to include
> both users

As Eric said, the 'user' only supports one initial user.
The 'user' is really only to avoid completely hard coding 'ubuntu'.  It
doensn't attempt to create a user or verify they have 'su' credentials
either.

I wouldn't be opposed to supporting multiple users there, but I'm not sure
I understand why.  The key that you put in there would then get copied to
both accounts, basically making the user the same until some subsequent
configuration change (which could also pull in some keys).

One fairly nice feature that the Lucid images have is the
'ssh-import-lp-id' tool.  Using this, you can add your public ssh keys to
a launchpad account, and then run a command (via 'runcmd' or other) like:

sudo -Hu ${local_username} ssh-import-lp-id ${laundpad_user}

That will pull the launchpad ssh keys into the instance for that user.

I'm glad you found cloud-init / cloud.cfg to be useful.  Please let me
know any things you think could work better so we can improve it.
Scott



More information about the Ubuntu-cloud mailing list