Global.helma.Ssh.connectWithKey (username, key, passphrase)
connects to a remote host using private key and passphrase

  • Parameter String:
    username
  • Parameter String:
    path to keyfile
  • Parameter String:
    passphrase (if needed by key)
  • Returns
    Boolean
Sourcecode in /home/hannes/helma/modules/helma/Ssh.js:
171:   this.connectWithKey = function(username, key, passphrase) {
172:           var keyFile;
173:           if (!username || !(keyFile = getFile(key))) {
174:               error("connectWithKey", "Insufficient or wrong arguments.");
175:           } else if (connect() && connection.authenticateWithPublicKey(username, keyFile, passphrase)) {
176:               debug("connectWithKey", "authenticated with key");
177:               return true;
178:           } else {
179:               error("connectWithKey", "Authentication failed!");
180:          }
181:          return false;
182:      }