# SFTP

Use SFTP connector to interact with a SFTP server. Primary functions include uploading and downloading files from an SFTP server, but its capable of other tasks like creating remote directories and listing files and directories on the SFTP server.

## Managing Connector : Add, Edit, or Delete

Follow the [steps in the link](https://docs.novacura.com/flow-connect/working-with-connect/connect-to-systems/managing-connector) as a guideline for connector actions: Add, Edit, and Delete.

## Configuration values

| Configuration                         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Agent Group**                       | Agent group where the connector should be executed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Server Address**                    | SFTP server's address                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Port**                              | Port number. Typically, the port is set to 22                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Username & Password**               | Credentials for the SFTP user to connect to SFTP server                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Client's Private Key Path**         | Used for key based authentication. Specify the path to the file containing the client private key. This path/file should be accessible to the connector agents installed on customer premises.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Password For Client's Private Key** | Password associated with the private key file                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Server Validation Type**            | <p>Determine the server validation type.  </p><ul><li><strong>None</strong> - No validation</li><li><strong>Server Public Key</strong> - Attach the server's public key which will be used to verify server's identity</li></ul><p>For security purposes, a public key is recommended.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **Transfer Type**                     | <p>Determines how the data is treated during transfer. </p><ul><li><strong>ASCII</strong> - text mode</li><li><strong>Binary</strong> - binary mode</li></ul><p>Binary is recommended and set as default.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Request Compression**               | If enabled, the connector agent will demand compression explicitly from SFTP server. Default is false.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Key Exchange Algorithms**           | <p>Key exchange algorithm define how the client and server securely negotiate shared symmetric keys<strong>.</strong> Some algorithms are enabled by default.</p><p><br>✅ - Enabled by default</p><p></p><p><strong>Diffie-Hellman (DH)</strong></p><ul><li>DH Group</li><li>DH Group Exchange</li><li>DH Group 14</li><li>DH Group Exchange (SHA256)</li><li>DH Group 14 (SHA256) ✅</li><li>DH Group 15 (SHA512)</li><li>DH Group 16 (SHA512) ✅</li><li>DH Group 17 (SHA512)</li><li>DH Group 18 (SHA512) </li></ul><p></p><p><strong>RSA</strong></p><ul><li>RSA 1024 (SHA1)</li><li>RSA 2048 (SHA256) ✅ </li></ul><p></p><p><strong>Elliptic Curve Diffie-Hellman (ECDH)</strong></p><ul><li>ECDH NIST P-256 ✅</li><li>ECDH NIST P-384 ✅</li><li>ECDH NIST P-521 ✅</li><li>ECDH NIST K-163</li><li>ECDH NIST P-192</li><li>ECDH NIST P-224</li><li>ECDH NIST K-233</li><li>ECDH NIST B-233</li><li>ECDH NIST K-283</li><li>ECDH NIST K-409</li><li>ECDH NIST B-409</li><li>ECDH NIST K-571</li><li>ECDH Curve25519 ✅ </li></ul><p></p><p><strong>Curve25519 and Curve448</strong></p><ul><li>Curve25519 ✅</li><li>Curve448 ✅ </li></ul><p></p><p><strong>GSS (Generic Security Services)</strong></p><ul><li>GSS Group Exchange</li><li>GSS Group</li><li>GSS Group 14</li></ul> |

## Operations

| Directory Operations                                                                                                              | Description                                                 |
| --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| [Directory Exists](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/sftp-module#directoryexists) | Determines whether a directory exists at the specified path |
| [Create directory](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/sftp-module#createdirectory) | Creates a directory at the specified path                   |
| [Delete Directory](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/sftp-module#deletedirectory) | Deletes the directory at the specified path                 |
| [List Directories](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/sftp-module#listdirectories) | Lists all files and directories in the specified path       |

| File Operations                                                                                                            | Description                                        |
| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| [File exists](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/sftp-module#fileexists)    | Checks if a remote file exists                     |
| [Get File Size](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/sftp-module#getfilesize) | Gets the size, in bytes, of a remote file          |
| [Rename File](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/sftp-module#renamefile)    | Rename a remote file                               |
| [Copy File](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/sftp-module#copyfile)        | Copies a remote file into the selected destination |
| [Delete File](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/sftp-module#deletefile)    | Delete a remote file                               |
| [Delete Files](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/sftp-module#deletefiles)  | Delete multiple remote files based on mask         |

| Upload Operations                                                                                                           | Description                                                                                                         |
| --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [Upload File](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/sftp-module#uploadfile)     | Uploads a single file to the SFTP Server                                                                            |
| [Upload Files](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/sftp-module#uploadfiles)   | Upload multiple files to the SFTP Server                                                                            |
| [Upload Stream](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/sftp-module#uploadstream) | <p>Uploads the content of a Flow variable that contains a binary stream<br>e.g. Upload data from a camera input</p> |

| Download Operations                                                                                                             | Description                                                                                     |
| ------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| [Download File](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/sftp-module#downloadfile)     | Download a single file from the SFTP server to the machine where Flow Connect agent is running  |
| [Download Files](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/sftp-module#downloadfiles)   | Download multiple files from the SFTP server to the machine where Flow Connect agent is running |
| [Download Stream](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/sftp-module#downloadstream) | Download a file from SFTP server and store it as Flow variable                                  |
