diff --git a/index.js b/index.js index b13e51d..5d058f8 100644 --- a/index.js +++ b/index.js @@ -182,10 +182,12 @@ var AutoSSH = function (_EventEmitter) { key: 'generateExecString', value: function generateExecString() { var bindAddress = this.localPort + ':localhost:' + this.remotePort; - var exitOnFailure = '-o "ExitOnForwardFailure yes"'; + var exitOnFailure = '-o ExitOnForwardFailure=yes'; var serverAliveInterval = '-o ServerAliveInterval=' + this.serverAliveInterval; var serverAliveCountMax = '-o ServerAliveCountMax=' + this.serverAliveCountMax; - var options = exitOnFailure + ' ' + serverAliveInterval + ' ' + serverAliveCountMax; + var serverAliveOpts = serverAliveInterval + ' ' + serverAliveCountMax; + var strictHostCheck = '-o StrictHostKeyChecking=no'; + var options = exitOnFailure + ' ' + serverAliveOpts + ' ' + strictHostCheck; var privateKey = this.privateKey ? '-i ' + this.privateKey : ''; var userAtHost = this.username + '@' + this.host; diff --git a/src/index.js b/src/index.js index 6e3e1c7..45d6b13 100644 --- a/src/index.js +++ b/src/index.js @@ -150,10 +150,12 @@ class AutoSSH extends EventEmitter { */ generateExecString() { const bindAddress = `${this.localPort}:localhost:${this.remotePort}`; - const exitOnFailure = '-o "ExitOnForwardFailure yes"'; + const exitOnFailure = '-o ExitOnForwardFailure=yes'; const serverAliveInterval = `-o ServerAliveInterval=${this.serverAliveInterval}`; const serverAliveCountMax = `-o ServerAliveCountMax=${this.serverAliveCountMax}`; - const options = `${exitOnFailure} ${serverAliveInterval} ${serverAliveCountMax}`; + const serverAliveOpts = `${serverAliveInterval} ${serverAliveCountMax}`; + const strictHostCheck = `-o StrictHostKeyChecking=no`; + const options = `${exitOnFailure} ${serverAliveOpts} ${strictHostCheck}`; const privateKey = this.privateKey ? `-i ${this.privateKey}` : ''; const userAtHost = `${this.username}@${this.host}`;