Forward SSH agent socket into a container
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 4 commits behind uber-common:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Forward SSH agent socket into a container

Still experimental -- contact or if you want help.


Assuming you have a /usr/local

$ git clone git://
$ cd docker-ssh-agent-forward
$ make
$ make install

On every boot, do:


and the you can run pinata-ssh-mount to get a Docker CLI fragment that adds the SSH agent socket and sets SSH_AUTH_SOCK within the container.

$ pinata-ssh-mount
-v ssh-agent:/ssh-agent -e SSH_AUTH_SOCK=/ssh-agent/ssh-agent.sock

$ docker run -it $(pinata-ssh-mount) 
/ssh-agent-forward ssh -T
The authenticity of host ' (' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ',' (RSA) to the list of known hosts.
PTY allocation request failed on channel 0
Hi avsm! You've successfully authenticated, but GitHub does not provide shell access.

To fetch the latest image, do:



To build an image yourself rather than fetching from Docker Hub, run ./ from your clone of this repo.

We didn't bother installing the build script with the Makefile since using the hub image should be the common case.


License is ISC.