SFTP
SFTP is a secure way to move files to and from a server. The SFTP connector lets TAO browse, read and search files on that server, and, with a person's approval, upload, rename, create folders and delete.
What you can do
Illustrative examples.
- Ask Nexus to list the files in a bank's drop folder and tell you which arrived today.
- Search a log file for the word "error" and show the matching lines.
- Read the last 50 lines of a nightly export to check it finished.
- Upload a report to a partner's server, after you approve it.
- Use the SFTP workflow node to do the same steps inside a workflow. See App nodes.
Before you connect
You need:
- The server host name and port (the usual port is 22, and the form fills it in).
- A username.
- Either a password, or a private key (a long secret text that proves who you are) and its passphrase if it has one.
- A root directory. TAO can only see inside this folder. Choose the smallest folder that does the job.
Ask your server administrator for a login with the fewest rights possible. The form's own hint says the same: use a least-privilege login rooted in the smallest required directory.
Connect it
Open Connectors
Go to Settings > Connectors and find SFTP server. Click Add.
Fill in the server details
Enter Host, Port, Username and Root directory. All four are required.
Choose how to sign in
Under Authentication, pick password or private_key. Then fill in Password, or Private key and Key passphrase.
Save and test
Save the connection, then click Test connection. The result reads Connection works or Connection failed, with the checks it ran.
You can save more than one connection and give each a name. One is the default. Tools use the default unless a connection is named.
Tools
| Tool name | What it does | Read or Write |
|---|---|---|
sftp_list_connections | Lists your SFTP connections | Read |
sftp_list_directory | Lists the entries in a folder | Read |
sftp_find_files | Finds files by name pattern, date or size | Read |
sftp_file_info | Shows size, modified time and type of one file | Read |
sftp_read_file | Reads part of a text file | Read |
sftp_tail_file | Reads the last lines of a text file | Read |
sftp_grep_file | Searches a text file for text | Read |
sftp_download_file | Downloads a file into the chat session | Read |
sftp_upload_file | Uploads a file | Write, waits for approval |
sftp_rename | Renames or moves a file | Write, waits for approval |
sftp_make_directory | Creates one folder | Write, waits for approval |
sftp_delete_file | Deletes a file. You must give its exact name | Write, waits for approval, cannot be undone |
sftp_remove_directory | Removes an empty folder. You must give its exact name | Write, waits for approval, cannot be undone |
Total: 13 tools. 8 read, 5 write.
Limits and good to know
- Approval is always required for writes, even when a chat is set to skip approvals. The approval card shows the connection, server and exact path. It never shows your password or key.
- Deletes are double checked. TAO compares the file again after you approve. If it changed in between, nothing is deleted.
- Nothing is overwritten. Upload and rename refuse a name that already exists. There is no recursive delete.
- Size limits. Reads return up to 48 KiB at a time. Downloads are limited to 25 MiB. Uploads are limited to 25 MiB from a file, or 256 KiB typed inline. Lists show up to 200 entries. Searching a file scans up to 64 MiB.
- Text only. Binary files are refused. Reads default to UTF-8, with other encodings available.
- Stays inside the root folder. Links that point outside it are refused, and TAO never follows a link when deleting.
- Downloads need a chat. A workflow node cannot download a file.
- Where approvals appear. Writes show up in Nexus under Approvals.
- Administrators can pin the server's key or limit which addresses may be used. The code shows these as admin settings, not user settings.