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

User is ignored in an SSH DOCKER_HOST #107

Closed
bwateratmsft opened this issue Oct 16, 2019 · 4 comments · Fixed by #108
Closed

User is ignored in an SSH DOCKER_HOST #107

bwateratmsft opened this issue Oct 16, 2019 · 4 comments · Fixed by #108

Comments

@bwateratmsft
Copy link
Contributor

Due to a combination of defaultOpts (https://github.com/apocas/docker-modem/blob/master/lib/modem.js#L16) and this line, any value passed in as the user in DOCKER_HOST would be ignored. I believe the behavior would be that the current user is used. There's a high chance that won't work, however--if the local username is not the same as the SSH username.

Ideally we should alter defaultOpts to permit things like ssh://user@host

@bwateratmsft
Copy link
Contributor Author

I noticed an additional problem. It isn't possible to pass the agent either, so ssh-agent-based auth (which is the only option that can actually work with Docker) doesn't work.

@bwateratmsft
Copy link
Contributor Author

@apocas I noticed in 8937fc4 you removed the ssh config object passed through above; what was the reason behind that? We'd have to add it back, or something similar, in order to support passing in the agent.

@apocas
Copy link
Owner

apocas commented Oct 17, 2019

You should be able to pass an "agent" to the Modem.
https://github.com/apocas/docker-modem/blob/master/lib/modem.js#L81

I simplified it, by using the already existing "host" and "port" from Modem's constructor.
https://github.com/apocas/docker-modem/blob/master/lib/modem.js#L72

@bwateratmsft
Copy link
Contributor Author

@apocas I see that now. We can pass agent through dockerode to docker-modem. Ideally docker-modem would support that via DOCKER_HOST and SSH_AUTH_SOCK env vars, which is roughly what the Docker CLI does as well. I created #108

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 a pull request may close this issue.

2 participants