Skip to content

Adding passwordless SSH and fixing some of the spec files - #141

Merged
portertech merged 8 commits into
test-kitchen:masterfrom
miroswan:adding-passwordless-ssh
Jul 17, 2015
Merged

Adding passwordless SSH and fixing some of the spec files#141
portertech merged 8 commits into
test-kitchen:masterfrom
miroswan:adding-passwordless-ssh

Conversation

@miroswan

Copy link
Copy Markdown
  • Adding passwordless SSH
  • Fixing issue with legacy include statements in default spec tests.

@coderanger

Copy link
Copy Markdown
Contributor

Love the idea, but we can't do this with a static private key :-/ The security issues would be too dangerous. Any chance you could change this to generate a new key pair using something like https://stackoverflow.com/questions/5270386/generate-ssh-keypairs-private-public-without-ssh-keygen ?

@miroswan

Copy link
Copy Markdown
Author

I was actually thinking about generating the key on the host and injecting the public key into the container. I think ssh-keygen would have to be installed on the host, which might be problematic for Windows users. Perhaps there is another way. I'll take a look at that stackoverflow link.

@coderanger

Copy link
Copy Markdown
Contributor

Yeah, you can do it all in Ruby code using the ssh_type and to_blob methods mentioned in that post.

@coderanger

Copy link
Copy Markdown
Contributor

Also if you want to be really fancy, you could use something like https://github.com/coderanger/kitchen-sync/blob/master/lib/kitchen-sync/rsync.rb#L46 to grab an existing identity from ssh-agent and then fall back to creating a new one if that fails.

@miroswan

Copy link
Copy Markdown
Author

I have some new code to start. I'm using the sshkey library to generate the pairs. Let me know what you think. I'm assuming it could use some graceful error handling. At least it's a working draft.

@coderanger

Copy link
Copy Markdown
Contributor

Given this can be done easily with net-ssh already, I'm not sure it is worth the extra dependency.

@miroswan

Copy link
Copy Markdown
Author

Kinda like how easy sshkey makes it, but I can take a look at net-ssh soonish.

@miroswan

Copy link
Copy Markdown
Author

Using net/ssh now.

@jeffbyrnes

Copy link
Copy Markdown

👍 to this, I’ve tested and it fixes #110 and #81 as far as I can tell.

@coderanger

Copy link
Copy Markdown
Contributor

Love it. @portertech any thoughts on overall thumbs up/down? If not I'll merge this soon.

Comment thread lib/kitchen/driver/docker.rb Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruby style? Maybe this should be !File.exist?()?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or use unless 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, also needs || instead of or but I can fix that up post merge.

@miroswan

Copy link
Copy Markdown
Author

@coderanger Did you want me to make these adjustments? I don't mind.

@miroswan

Copy link
Copy Markdown
Author

I updated. I chose not to go with unless because it's sometimes unclear if the negation applies to both. Did correct the style though.

@portertech

Copy link
Copy Markdown
Contributor

299

portertech added a commit that referenced this pull request Jul 17, 2015
Adding passwordless SSH and fixing some of the spec files
@portertech
portertech merged commit 2f1dda3 into test-kitchen:master Jul 17, 2015
@portertech

Copy link
Copy Markdown
Contributor

@miroswan Thank you 👍 Will try to get this into a release before the weekend!

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.

4 participants