Use the Secure Shell protocol to execute commands on a remote server using a username and password
Go to siteThe SSH (password-based auth) app on Pipedream facilitates the orchestration of commands and automations on remote servers securely. With it, you can execute shell commands, manage files, and run scripts on your server as part of Pipedream workflows. This unlocks the potential for a host of automations like deploying applications, monitoring system performance, or automating backups — all triggered by events from numerous apps supported on Pipedream.
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()
},
})
Automated Deployment on Git Push: When a new commit is pushed to a specific branch on GitHub, trigger a Pipedream workflow that uses SSH to pull the latest code changes and restarts the application on a remote server. This streamlines deployment processes and ensures that the latest version is always running.
Scheduled Database Backups: Set up a Pipedream workflow that triggers on a schedule (e.g., nightly) to SSH into your server and execute a database backup script. The workflow could then save the backup file to cloud storage like Google Drive or Dropbox, offering you both automation and offsite backup storage.
Real-time Server Monitoring and Alerts: Create a Pipedream workflow that periodically runs diagnostics via SSH on your server. The results could be sent to a monitoring app like Datadog, or used to trigger alerts via email or Slack if certain metrics exceed predefined thresholds, ensuring prompt response to potential issues.
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.