-
Notifications
You must be signed in to change notification settings - Fork 38
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
Howto use in combination with a ssh-agent? #55
Comments
I signed up for GitHub in 2013 and have literally never logged in since but I struggled with this exact issue for long enough that I dusted off my login details to hopefully save you some pain. gulp-ssh uses the ssh2 (https://github.com/mscdex/ssh2) node module for handling the actual SSh connections. And ssh2 has a variety of additional connection options including the 2 we need to get this working: agent and agentForward which you can find listed here: https://github.com/mscdex/ssh2#client-methods Agent forwarding works using a socket which is conveniently available under the environment variable SSH_AUTH_SOCK which you can access using So to put this all together.. your sshConfig hash would look like:
Hope this helps! |
I unfortunately had to discover this myself, having overlooked this response. One minor obvservation, I do not have to set agentForward: true. And I do not have it setup in my local ssh setup. I thought that agentForward forwarded all key identities as opposed to the identity tied to the public key on the server side? |
@casimirloeber This information needs to be in the README. That's ultra valuable. |
For writes, the only option that's needed is |
There is now a test for this and it's documented in the README. You can also set useAgent to |
I am using
gulp-ssh
within my gulpfile.js which is located inside a Vagrant box.I have enabled SSH forwarding agent to this box with the setting
config.ssh.forward_agent = true
.If I manually SSH into the box:
vagrant ssh
. And once on the terminal inside the box do assh myuser@myotherhost
I get connected without a password prompt. So far so good.But how can I configure Gulp-SSH to make use of this forwarded private key also? Because I can't configure the password in gulp-ssh and also I can't configure the private key, since it is not available inside the vagrant box.
Any ideas/help is welcome.
The text was updated successfully, but these errors were encountered: