Use the Secure Shell protocol to execute commands on a remote server using a username and password
Write custom Node.js code and use any of the 400k+ npm packages available. Refer to the Pipedream Node docs to learn more.
The 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()
},
})
// To use previous step data, pass the `steps` object to the run() function
export default defineComponent({
async run({ steps, $ }) {
// Return data to use it in future steps
return steps.trigger.event
},
})