teambition / gulp-ssh

SSH and SFTP tasks for gulp
184 stars 38 forks source link

Connection closes without any warning #15

Closed chris-equis closed 9 years ago

chris-equis commented 9 years ago

Guys, I want to execute some commands on a remote server that I'm connecting through SSH with private/public keys.

The configuration is pretty basic:

gulpSSH = require('gulp-ssh')({
  ignoreErrors: false,
  sshConfig: {
    // config.ssh is an Object that have hostname and username properties
    host: config.ssh.hostname,
    username: config.ssh.username,
    port: 22
  }
});

and the task, the in the same basic manner

gulp.task('deploy-run', function() {
  return gulpSSH
    .shell(['mkdir x'], {filePath: 'ssh.log'})
    .pipe(dest('.logs'));
});

what console outputs when I type gulp deploy-run is

$ gulp deploy-run
Using gulpfile /<path-to-project>/gulpfile.js
Starting 'deploy-run'...
gulp-ssh :: Connect...
gulp-ssh :: Close

ssh.log file is created in ./.logs but it has no content, unfortunately :(

Is there any issue with gulp-ssh or the configuration?

zensh commented 9 years ago

connection is failure. maybe some error in your username/password?

chris-equis commented 9 years ago

I authenticate with SSH key. From terminal it works just fine, from gulp plugin it does not.

zensh commented 9 years ago

This plugin should refactor with ssh2-streams, I will do it this weekend.

zensh commented 9 years ago

Hi, v0.4.0 released, it work well in my PC.

chris-equis commented 9 years ago

I will try also today or tomorrow. Thank you!