Closed stefanwalther closed 8 years ago
Please make sure your id_rsa
correct
I have this issue too - I'm unsure how to provide the passphrase required for the encrypted key?
I had the same issue: You have to add a passphrase to the config, like this
var configKey = {
host: '10.0.0.222',
port: 22,
username: 'myuser',
privateKey: fs.readFileSync( expandTilde('~/.ssh/id_rsa'))
passphrase: 'your_passphrase_here'
};
It would be cool if author will add this to description page.
It's interesting that I do not need to supply a passphrase using gulp-rsync (for the same credentials and same gulp file) or from the command line running ssh manually (nor do I need to explicity indicate the keyfile). Once I have a shell that is successfully logged in with destination X and supplied passphrase, I never seem to need to enter it again for subsequent SSH sessions. I assume the passphrase has been associated with the key somehow. Is there a way to have gulp-ssh exhibit the same behavior as I experience from gulp-rsync and command line ssh? If I have to supply the passphrase each time, maybe allow for command line interaction like Fabric or others? I do not want to store my passphrase in the clear or in a separate file
For anyone coming to this issue, I was able to achieve my traditional bash ssh-agent based login experience with gulp-ssh. After reviewing, gulp-ssh is just using SSH2. Reviewing the SSH2 docs there is a config parameter, agent, that can point to the ssh-agent socket and provide auto login with ssh identity and cached key passphrase. Steps:
var config = { ... username: xxx, agent: '<the results of echo $SSH_AUTH_SOCK>', ... };
@daveobike How can I get the SSH_AUTH_SOCK variable on Windows while using Pageant?
When using the following code and using a passphrase protected key, I get the error:
Code:
Any ideas how to fix that?
Regards Stefan