Skip to content
This repository has been archived by the owner on Mar 27, 2018. It is now read-only.

Simplify ssh key usage with whilp/ssh-agent and yaml syntax #19

Closed
rosskevin opened this issue Oct 2, 2015 · 4 comments
Closed

Simplify ssh key usage with whilp/ssh-agent and yaml syntax #19

rosskevin opened this issue Oct 2, 2015 · 4 comments
Assignees

Comments

@rosskevin
Copy link
Member

See http://stackoverflow.com/questions/32897709/ssh-agent-forwarding-inside-docker-compose-container/32911979#32911979

Similar to gems, this uses a long running volume. Perhaps we can inject an interpolated single ssh-agent container into the yaml for use, with a single command, then clean it up afterwards?

@rosskevin
Copy link
Member Author

Do something similar to #20

# Make the host user's id_rsa key available to the web container e.g. for cloning from github
ssh-agent:
  containers:
    - web
  keys:
    - id_rsa

Should generate a seed default config of

compose:
  web:
    environment:
      # make ssh keys available via ssh forwarding (see volume entry)
      - SSH_AUTH_SOCK=/root/.ssh/socket

    volumes_from:
      # Use configured whilp/ssh-agent long running container for keys
      - ssh-agent

It will also create the container and populate it with keys, prior to up. I think we need to use a project_name based name for the ssh container though, and clean it up, unless we want our keys in a volume sticking around...

rosskevin added a commit that referenced this issue Oct 2, 2015
…ional, and workout conveniences with strict host key verification. Applies to #19
@rosskevin
Copy link
Member Author

Unknown hosts are still a problem (anything from bitbucket or github). Both of these fail with "Host key verification failed"

ssh -o 'StrictHostKeyChecking no' -T git@github.com
ssh -o 'StrictHostKeyChecking no' -T git@bitbucket.org

But these succeed

ssh -o 'StrictHostKeyChecking no' -T git@github.com
ssh -o 'StrictHostKeyChecking no' -T git@bitbucket.org

Need to figure out a way to either share ssh/config with an exclusion or known_hosts.

@rosskevin
Copy link
Member Author

As of daea2fc, this issue is solved, requires merging (or local building) of whilp/ssh-agent#3

@rosskevin
Copy link
Member Author

Fixed in 0.7.1

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

No branches or pull requests

1 participant