Use the Secure Shell protocol to execute commands on a remote server using a username and password
Go to siteThe SSH (Secure Shell) API provides users with a secure and reliable way to connect to a remote server. This can be used to connect to remote systems and transfer data and files, as well as manage and configure remote systems. With the SSH API, you can authenticate with a password-based authentication.
This is a powerful tool for managing remote systems and networks, providing a secure and efficient way to access and manage resources. You can use the SSH API to build the following applications and services:
module.exports = defineComponent({
props: {
ssh_password_based_auth: {
type: "app",
app: "ssh_password_based_auth",
}
},
async run({steps, $}) {
const SSH2Promise = require('ssh2-promise')
const {
host,
port,
username,
password,
} = this.ssh_password_based_auth.$auth
const ssh = new SSH2Promise({
host,
port,
username,
password,
})
await ssh.connect()
console.log("Connection established")
// Replace this with the command you'd like to run
const resp = await ssh.exec("whoami")
console.log(resp)
await ssh.close()
},
})
SSH (password-based auth) uses API keys for authentication. When you connect your SSH (password-based auth) account, Pipedream securely stores the keys so you can easily authenticate to SSH (password-based auth) APIs in both code and no-code steps.
This app holds details for a specific host or server where you want to run commands using the SSH protocol.
Below, enter the hostname and port of the server you'd like to connect to, your username, and the private key you'd like to use to connect.
This app only supports key pair authentication, not authentication via password. If you need to use a username / password to connect to a host, please use the SSH (key-based auth) app, instead.