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

Allow use of ssh-agent instead of mounting SSH key #15

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dw-ec
Copy link

@dw-ec dw-ec commented Jun 7, 2023

Mounting an SSH key into the docker-ssh-tunnel container requires that it be unprotected by a passphrase, or for the passphrase to be stored in the container config. This is insecure.

As an alternative, this change allows the user to forward their ssh key agent SSH_AUTH_SOCK into the container. When this environment variable is defined, the ssh command in run.sh will not attempt to use a private key file, but instead will use the default behaviour of looking for an agent socket at the path ${SSH_AUTH_SOCK}.

Successfully tested on Docker Desktop for Mac.

@dw-ec
Copy link
Author

dw-ec commented Jun 27, 2023

I've cleaned up the PR to make the change as minimal as possible while providing useful command options to the README.md.

@dw-ec
Copy link
Author

dw-ec commented Jul 31, 2023

I've updated the example in the docs to use the user's ${SSH_AUTH_SOCK} env var instead of hard-coding the path.

This works in WSL (Ubuntu:22.04 with docker integration enabled); as well as on a Mac, so it's more cross-platform now.

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.

1 participant