-
Notifications
You must be signed in to change notification settings - Fork 101
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
SSH Agent Forwarding With VS Code Remote-SSH #1593
Comments
This appears to be an issue with |
As a quick fix, I was able to work around this by setting my |
@David-Igou, here's an alternative approach that doesn't require you to find out what the path is to your socket:
I ended up setting an alias that included this approach so it didn't matter if I was ssh'ing directly into the host from a terminal or whether I was using VSCode Remote SSH. The above just checks to see if |
Thanks @David-Igou and @snapp I appreciate the work-arounds. Thanks @ssbarnea for dropping it on the board for a longer term fix. |
ISSUE TYPE
SUMMARY
Symbolic links are not followed when determining the volume mount paths for the SSH agent forwarding bits.
Running on Mac OS I add an SSH key with a passphrase into my SSH agent. Leveraging VS Code with the Remote-SSH plugin I forward the agent into remote host. This works fine, the remote host can run
ssh-add -l
and I see the key and am able tossh
into the managed node I want to use withansible-navigator
.The VS Code Remote-SSH plugin sets up
SSH_AUTH_SOCK
to point to a file within thetmpdir
configuration value in the plugin which seems to be/run/user/<uid-of-remote-host-user>
. It essentially just creates a symbolic link to the normal file where the forwarded agent is placed byssh
.ANSIBLE-NAVIGATOR VERSION
CONFIGURATION
LOG FILE
VS Code Remote-SSH Log
STEPS TO REPRODUCE
ssh-add -i ...
commandansible-navigator
(from the AAP 2.4 repos in my case)ansible-navigator exec bash
and inspect the SSH agent withssh-add -l
and notice it fails to connect.EXPECTED RESULTS
I'd expect the SSH agent is forwarded into the VM correctly.
ACTUAL RESULTS
It fails to connect to the SSH agent specified by
SSH_AUTH_SOCK
in the environment.ADDITIONAL INFORMATION
I know this is a bit of an esoteric configuration but I keep trying different ways to use SSH keys particularly ones protected by passphrases with
ansible-navigator
starting from Mac OS and am just continuously coming up empty.The text was updated successfully, but these errors were encountered: