SFTP Upload
Input
✳️ Any (string
)
Ouptut
✳️ Any (JSON
) (Passthrough)
Summary
This action allows you to upload an SFTP file to a remote SFTP server.
The contents of the file should be passed in as a pipeline variable and in a string-like format.
SFTP Information
SFTP stands for SSH File Transfer Protocol. SFTP is an out-of-the-box component included with sshd
and is available by default on the majority of modern Linux server distributions. It is similar, but superior, to SCP. Most servers that support SCP also support SFTP.
Careful! It’s easy to confuse SFTP, FTP, and FTPS!
SFTP is a newer protocol built on top of sshd
and relies on Unix-like logins and permissions.
FTP is the older protocol that runs on port 21. Servers can be hosted on Windows (via IIS or Filezilla) or on Linux (via tools like ProFTPD or vsftpd).
FTPS is to FTP like HTTPS is to HTTP – it’s simply FTP with TLS encryption on top.
You can verify that SFTP is enabled by reviewing the /etc/sshd/sshd_config
file on the server, and ensuring that a line similar to this one exists:
Subsystem sftp <server-path-or-identifier-here>
Additional configuration may be necessary (e.g. to configure chroot jails).
Limitations
Public key authentication is not supported at this time. The server’s SSH daemon must be configured to allow password-only authentication.
The username must have
rwx
at their base SFTP directory level. If you are usinginternal-sftp
’s chroot jail feature, this is handled automatically.r-x
is required to check if the file already exists (viastat()
)-w-
is required to upload the file
Properties
Name | Type | Templatable | Notes |
---|---|---|---|
Upload Data | Text | The contents of the file to write. It is recommended to enter a template expression that evaluates to a string (such as the output from the Convert to CSV action). If an object (such as an array or JSON object) is passed in, it will be converted to a string first. | |
Server Name / IP | Text | The hostname or IP address of the server to connect to. If a hostname is used, the hostname must be resolvable via public DNS. | |
Port | Number | The port number. The default SFTP port is 22, if you are unsure, use that. | |
Username | Text | The username to authenticate with. | |
Password | Text | The password to authenticate with. | |
Host Key | Text | Optional. If specified, the host key will be checked against this value. If they do not match, the connection will be rejected and the action will fail. Host key should be in the following format:
| |
Fingerprint | Text | Optional. If specified, the host fingerprint will be checked against this value. If they do not match, the connection will be rejected and the action will fail. Host fingerprint should be in the following format:
| |
File Path | Text | The path of the file to write. Depends on server requirements. Some servers require an absolute path that starts with “/”, others accept relative paths or just filenames. Tip: Use a template expression to create a date-based or unique filename. | |
Overwrite Existing Files | Checkbox | Whether or not to overwrite a file if one by the same name already exists. May fail depending on the permissions set up on the SFTP server. |