---
title: c SFTP
description: Available connectors
documentId: ipaas-sftp
locale: en-US
---

The [**SFTP**](https://camel.apache.org/components/4.10.x/sftp-component.html) component provides access to remote file systems through the FTP and SFTP protocols. Operation only in passive mode.

**URI syntax**: `sftp:host:port/directoryName`

## Main fields

*Path parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|---------------|------------|----------|
| `host` (common)         | (required) FTP server hostname.| — | String |
| `port` (common)         | FTP server port.                     | — | int    |
| `directoryName` (common)| Initial directory.                         | — | String |

*Query parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|---------------|------------|----------|
| `username` (security) | Username for authentication on the SFTP server.| — | String |
| `password`(security)  | Password for authentication on the SFTP server.          | — | String |
| `fileName`(common)    | Used to dynamically set the file name as an expression. In the consumer, serves as a name filter; in the producer, to evaluate the file name to write. | — | String | 
|`passiveMode` (common) | Defines that the SFTP connection should use passive mode.  |false| boolean |

## Example

<Steps>
  <Step>
   The flow is triggered by a Quartz trigger, which fires every minute.
  </Step>
  <Step>
   When the flow starts, the message body is set to `Hello World`.
  </Step>
  <Step>
   Next, the flow sends this message as a file named `helloworld.txt` to an SFTP server at address `demo.wftpserver.com`, on port `2222`, in the `/upload` directory.
  </Step>
</Steps>

```yaml
- from:
  uri: "quartz://ipaas/trigger"
  parameters:
    cron: "* * * * *"
  steps:
  - setBody:
    constant: "Hello World"
  - to:
    uri: "sftp://demo.wftpserver.com:2222/upload"
    parameters:
      username: "demo"
      password: "demo"
      fileName: "helloworld.txt"
      passiveMode: true
```

![](https://creative-ball-51b3fc85c0.media.strapiapp.com/sftp_connector_5d37103f6b.png)

### Result

![](https://creative-ball-51b3fc85c0.media.strapiapp.com/sftp_connector_result_3178174f22.png)

<Callout type="note" title="NOTE">
- The connection configured in the example does not validate the SFTP server's identity, which means it would not detect potential security issues.

- For secure validation, Apache Camel allows using a `known_hosts` file. To do this, it is necessary to:
  1. Include the `known_hosts` file as a **resource** in the integration.
  2. Configure the `knownHostsFile` parameter pointing to the file.
  3. Enable the `strictHostKeyChecking` parameter.

Read more about [Resources](/docs/integrations/ipaas-resources) files.
</Callout>
