Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

question: ssh agent forwarding #82

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

question: ssh agent forwarding #82

rosskevin opened this issue Oct 2, 2015 · 4 comments

Comments

@rosskevin
Copy link
Contributor

I'm having some problems getting ssh agent forwarding to work on OSX, wondering if there are any dinghy tricks to help.

Here is my setup:
http://stackoverflow.com/questions/32897709/ssh-agent-forwarding-inside-docker-compose-container

This related comment states that virtualbox doesn't allow socket sharing.

---
web:
  build: "."
  working_dir: "/project"
  ports:
  - '3000'
  environment:
  - SSH_AUTH_SOCK=/ssh-agent
  volumes:
  - "/private/tmp/com.apple.launchd.ZxGtZy6a9w/Listeners:/ssh-agent"
  command: bash -c "sleep 10 && echo 'foo' && exit 187"

If I run docker-compose run web bash, then docker inspect ID, I see

        "Volumes": {
            "/project": {},
            "/ssh-agent": {}
        },
    "Mounts": [
        {
            "Source": "/private/tmp/com.apple.launchd.ZxGtZy6a9w/Listeners",
            "Destination": "/ssh-agent",
            "Mode": "rw",
            "RW": true
        },
        {
            "Name": "7ae8d939bd7ba0210a79fa14a3bb9a112a1b721525896533f3413c140d2a442f",
            "Source": "/mnt/sda1/var/lib/docker/volumes/7ae8d939bd7ba0210a79fa14a3bb9a112a1b721525896533f3413c140d2a442f/_data",
            "Destination": "/project",
            "Driver": "local",
            "Mode": "",
            "RW": true
        }
    ],

Any thoughts/tricks/tips?

@rosskevin
Copy link
Contributor Author

Just found this https://github.com/whilp/ssh-agent

@rosskevin
Copy link
Contributor Author

My SO post shows how to use it. Quite simple, would be nice though if the SSH_AUTH_SOCK just worked without the extra container.

@rosskevin rosskevin reopened this Oct 2, 2015
@codekitchen
Copy link
Owner

I'm not sure I totally follow what you're trying to do, but I do see that you're trying to mount your host's /private/tmp/com.apple.launchd.ZxGtZy6a9w/Listeners socket file into the container -- that's not going to work for two reasons:

  • dinghy only shares /Users/<you> over NFS into the boot2docker VM, nothing outside of the dir will be accessible by default.
  • even if you modified the NFS config so that this is shared, you can't share a socket file over NFS -- NFS only supports normal files.

I'm not sure if virtualbox shared folders support socket files, if they do then potentially you could get it working that way.

@rosskevin
Copy link
Contributor Author

Thanks, will stay with automating the whilp/ssh-agent

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

No branches or pull requests

2 participants