SSH2 Promise
SSH2 gives you a secure way to access a computer over an unsecured network. This integration provides ssh2 with asynchronous functions
- JavaScript
Network Connection needs
This integration needs network access to the server where the service is running.
See the Network access page for details about how to achieve that.
Credential configuration
To configure this credential you need the host
, port
and username
to connect to the SSH server.
Additionally, you'll need a password
or the private key
depending on how you want to connect.
Optionally, you can set any of the extra config parameters you can see here, in the constructor method.
Here is an example of a filled credential configuration form in YepCode:
SSH2 Promise snippets available in editor
The title is the triggering text for YepCode to autocomplete the script.
- JavaScript
- Python
Integration
const sshConnection = yepcode.integration.ssh2Promise("credential-slug");
const SSH2Promise = require("ssh2-promise");
const options = {
host: "hostname",
port: portNumber,
username: "username",
password: "password",
};
const sshConnection = await new SSH2Promise(options).connect();
const SSH2Promise = require("ssh2-promise");
const options = {
host: "hostname",
port: portNumber,
username: "username",
privateKey: "privateKey",
};
const sshConnection = await new SSH2Promise(options).connect();
Execute Shell Commands
sshConnection.exec("your-command").then((data) => {
// Use the received data
console.log(data);
sshConnection.close();
});
const data = await sshConnection.exec("your-command");
// Use the received data
console.log(data);
sshConnection.close();
Comming soon
We are releasing new Python features every week