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

Forward the host SSH agent socket into the container #853

Merged
merged 2 commits into from
Jul 5, 2023

Conversation

gouttegd
Copy link
Contributor

This PR:

  • binds the SSH agent socket (as found in $SSH_AUTH_SOCK) from the host to a predictable location inside the container;
  • sets the SSH_AUTH_SOCK variable in the container to point to said predictable location.

This allows processes running inside the container to communicate with the host's SSH agent and therefore to use the user's SSH keys without having to expose the keys directly to the container.

closes #852

This commit:

* binds the SSH agent socket (as found in $SSH_AUTH_SOCK) from the host
  to a predictable location inside the container;
* sets the SSH_AUTH_SOCK variable in the container to point to said
  predictable location.

This allows processes running inside the container to communicate with
the host's SSH agent and therefore to use the user's SSH keys without
having to expose the keys directly to the container.

closes #852
@gouttegd gouttegd self-assigned this Apr 17, 2023
@gouttegd gouttegd requested a review from matentzn April 17, 2023 17:40
@matentzn
Copy link
Contributor

Thanks @gouttegd I will look at this after biocuration unless there is a reason to rush?

@gouttegd
Copy link
Contributor Author

No emergency as far as I am concerned. This may solve #848, if the user here is using a SSH agent (which they probably do).

@gouttegd
Copy link
Contributor Author

gouttegd commented Jul 5, 2023

Ping @matentzn. This is very simple change that does not alter the behaviour of the ODK, except that it makes it possible to use SSH with agent-provided keys from within the container.

Copy link
Contributor

@matentzn matentzn left a comment

Choose a reason for hiding this comment

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

Lets merge and try, I can understand the general outline but without testing, no way for me to provide a proper review!

@gouttegd gouttegd merged commit 0e14e66 into master Jul 5, 2023
1 check passed
@gouttegd gouttegd deleted the forward-ssh-agent-socket branch July 5, 2023 09:39
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.

Make possible to use user’s SSH keys from within the ODK container
2 participants