Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding support for using authorized_keys from a service account #7

Merged
merged 1 commit into from
Mar 3, 2014
Merged

adding support for using authorized_keys from a service account #7

merged 1 commit into from
Mar 3, 2014

Conversation

someara
Copy link
Contributor

@someara someara commented Feb 27, 2014

No description provided.

@anl
Copy link
Contributor

anl commented Mar 2, 2014

So setting "public_key_path" for GCE looks like it works by setting the "sshKeys" custom metadata - for user "root" only, AFAICT, although I haven't yet found the code in Fog that does this? Does that match what you're seeing?

@someara
Copy link
Contributor Author

someara commented Mar 2, 2014

Hi Andy.
This is passed by fog here: https://github.com/fog/fog/blob/master/lib/fog/google/models/compute/servers.rb#L76

It's the same as doing this with the gcutil CLI https://gist.github.com/someara/a01cac108b5a966dbb44

The google_key_location signs the API request and literally uploads the ssh public key as part of the API call.

It lets me do this: https://github.com/opscode-cookbooks/build-essential/blob/master/.kitchen.cloud.yml#L63

From there, its up to the image to Do The Right Thing.... and there are bugs in the images.
For example, the centos-6 image doesn't seem to work as root.

I haven't tried debian-7 with any other user than root.

-s

@someara
Copy link
Contributor Author

someara commented Mar 2, 2014

I pasted this into the Fog repl at one point figuring this out:
https://gist.github.com/someara/5dceea5f7ad3211e788e

anl added a commit that referenced this pull request Mar 3, 2014
adding support for using authorized_keys from a service account
@anl anl merged commit dee9f3b into test-kitchen:master Mar 3, 2014
@anl
Copy link
Contributor

anl commented Mar 3, 2014

Awesome, thank you for the explanation - and the PR.

It looks like adding "username:" to connection.servers.create works around images like CentOS that have "PermitRootLogin no" set, when needed. (SSH logins to the GCE CentOS images are really slow then, but that appears to be because they have "GSSAPIAuthentication yes" set.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants