-
Notifications
You must be signed in to change notification settings - Fork 43
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
Use SSH agent forwarding instead of SSH keys #607
Conversation
You need to also configure the host system, but which hostname is used? Oh wait it should work. But it doesn't 💀
|
It seems it's not possible to forward the SSH agent socket into a container, I found multiple issues and complaints indicating this is not possible. @phansys please confirm this is possible, and I simple need to change something on my system (macOS) 🙏 |
Sure @sstok, this works. I've created this PR with the Docker image using these settings. I had to do this change because with the keys approach, the container was prompting for the passphrase every time:
|
Indeed, but I wonder why it's not working on my system 😫 |
Do you have SSH agent running locally? |
Please, let me know if you have any news on this. I'll try to help where possible. |
SSH agent is running, because on the host system I get a result with Using a modified version as I can't get in the container shell.
Result:
|
The container can't be different (or at least is what I think). IMO, there is no need to |
ssh-agent is not running on the Container, but on the host system ;) On the host I get an successful authentication and a result when running
|
hmm i am going to try now |
Let me change my entrypoint in order to compare my output with yours. |
|
Note the difference at
Mine:
|
test it outside of gush project, i am getting errors like this:
|
Let me do some changes in order to match the @sstok's output, changing file permissions, executing |
I've updated the file permissions manually and my access is kept intact:
|
|
|
Passing
|
Could you then pass the hardcoded UID |
using the |
So, just for recap, now your UID is |
See attachments. |
The difference between your output and mine is from line 89, and note that your debug level stop at 1 there while mine forwards to 2:
Mine
|
Could you please check the bitmask for your private and public key @sstok? https://help.ubuntu.com/community/SSH/OpenSSH/Keys |
hmm the problem of permission is common on the internets i bet, i just saw days ago an entry but didn't follow it through. I hope we can solve this. |
SSH agent is running, I can connect with the native system (macOS), but as soon as I enter Docker it refuses to connect! 😠 It almost seems Docker refuses to mount the socket file or something. On macOS: $ echo "he" > $SSH_AUTH_SOCK
zsh: operation not supported on socket: /private/tmp/com.apple.launchd.zYkDnlWlB6/Listeners In Docker: bash-4.3# echo "he" > $SSH_AUTH_SOCK
bash: /ssh-agent: No such device or address Btw I'm using the latest version of Docker: Docker version 1.12.0, build 8eab29e |
I did some testing with a PHP script, creating a local socket and on the host it works. Creating a socket in the Docker env, does work so it seems Docker is unable to mount a socket file (I guess it was possible, but buggy or something...).
Even changing the chmod of the socket to world writable, did NOT solve it. I'm going to try one last thing, I needed to update Docker so maybe an old version is conflicting (should not be the case on a Mac, but still). And update Virtualbox. Edit. Docker toolbox and Docker for Mac are not the same, |
OK, reinstalling the Docker toolbox did not solve the mounting problem 💀 I give-up. |
Using SSH agent forwarding.