Interact with an SFTP (SSH File Transfer Protocol) Server using a private key for auth
Go to siteThe SFTP (key-based auth) app on Pipedream allows you to securely transfer and manage files over a network. It uses SSH for data transfer and provides the same level of security as SSH, without requiring password authentication, making automation workflows more secure and less prone to human error. You can automate file uploads, downloads, synchronization tasks, and efficiently manage your remote files in a serverless environment. Integrating this with other Pipedream-supported apps enables you to craft powerful and secure data flow systems.
module.exports = defineComponent({
props: {
sftp: {
type: "app",
app: "sftp",
}
},
async run({steps, $}) {
const Client = require('ssh2-sftp-client');
const {
host,
username,
privateKey,
} = this.sftp.$auth
const config = {
host,
username,
privateKey,
}
const sftp = new Client()
await sftp.connect(config)
this.cwd = await sftp.cwd();
return await sftp.end();
},
})
Automated Data Backup: Sync local data to a remote SFTP server on a schedule. Whenever files are added or updated in a specific local directory, Pipedream triggers a workflow that automatically uploads these files to a designated SFTP folder, ensuring off-site backups are always up-to-date.
Log File Aggregation: Collect log files from multiple servers. Set up a Pipedream workflow that connects to various SFTP servers, downloads log files at regular intervals, and consolidates them into a single storage solution like Amazon S3 for analysis or long-term storage.
Web Content Deployment: After a Git push to the master branch, automatically deploy web content to a production server. Using Pipedream triggers that respond to GitHub events, fetch the latest web assets from the repository and upload them to the SFTP server, automating the deployment process.
Emit new events when files get created, changed or deleted from a remote directory. See the docs
Uploads a file or string in UTF-8 format to the SFTP server. See the documentation
SFTP (key-based auth) uses API keys for authentication. When you connect your SFTP (key-based auth) account, Pipedream securely stores the keys so you can easily authenticate to SFTP (key-based auth) APIs in both code and no-code steps.
This app holds details for an SFTP server you want to interact with in Pipedream.
Below, enter the hostname 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 SFTP (password-based auth) app, instead.