Documentation
GuidesConnections

Connect to an SFTP server

Connect an SFTP server, confirm its identity, read its files with Balto, and load them into your warehouse with an extract pipeline.

This page explains how to connect an SFTP server to a Project and use its files. Vendors and Partners often deliver data as files on an SFTP server. Balto can list and read those files where they are. An extract pipeline can load them into your warehouse on a schedule. For the steps that every provider shares, see Create and manage connections.

An SFTP connection is a read-only source. Bobsled AI doesn't write, rename, or delete files on the server.

Before you begin

Make sure that you have the role that creates connections. Then get the following details from the server's owner:

Detail
Example
Use
Host and portsftp.vendor.example, port 22The server that Bobsled AI connects to.
UsernameacmeThe user that Bobsled AI signs in as.
Password or private keyNot applicableThe sign-in credential for that user.
Host key fingerprintSHA256:n12MvHNNHSEj2OdIu3XWSD2pxsubkKkL6M3IALpMnzsProof that Bobsled AI reached the correct server.
Folder/outboundThe folder that holds your files.
Client IP allowlistNot applicableSome servers accept only listed client addresses. For more information, see IP allowlists.

Store the sign-in credentials in the following secrets that the Project uses:

  • For password sign-in, one secret for the password.
  • For key sign-in, one secret for the whole private key, including its BEGIN and END lines.
  • If the private key has a passphrase, a second secret for the passphrase.

Bobsled AI accepts the following private key formats:

  • OpenSSH keys
  • Traditional PEM keys (BEGIN RSA PRIVATE KEY or BEGIN EC PRIVATE KEY)
  • PuTTY version 2 keys

To convert a PKCS#8 key (BEGIN PRIVATE KEY), run the following command:

bash
ssh-keygen -p -f KEY_FILE

Replace the following:

  • KEY_FILE: the path to your private key file.

To convert a PuTTY version 3 key, export it from PuTTYgen with Conversions > Export OpenSSH key.

Required server access

Ask the server's owner to confirm the following:

  • The server has a public IPv4 address. Bobsled AI connects only to servers on the public internet, and it doesn't use IPv6.
  • The server offers SFTP to the user. Bobsled AI doesn't support FTP or FTPS.
  • The server accepts password or key sign-in. Bobsled AI doesn't support keyboard-interactive sign-in.
  • The server offers current SSH algorithms. Servers that offer only older algorithms fail the test.
  • The user can list and read the folder.
  • The server accepts the client address. For more information, see IP allowlists.

The saved folder isn't a security boundary. The server owner can confine the SFTP user to its folder on the server, for example with a chroot. Ask for this confinement if people that you don't trust can upload files or create links on the server.

Create an SFTP connection

To create an SFTP connection, do the following:

  1. On the Connections page, click Add connection, and then select SFTP.
  2. Enter a Display name, such as Vendor SFTP.
  3. In Host, paste the server address, such as sftp://acme@sftp.vendor.example:2222/outbound. Bobsled AI fills Host, Port, Username, and Folder (optional). It ignores a password in the address. You can also enter the values instead of pasting an address.
  4. Check each value.
  5. Click Check server. Bobsled AI reads the server's host key without signing in.
  6. Compare the key with the owner's fingerprint. For more information, see Confirm the server's identity.
  7. Click Trust this server.
  8. In Login method, select Password or Private key.
  9. Select the secrets that hold the sign-in credentials.
  10. Click Save connection. Bobsled AI tests the connection. The test signs in, opens the folder, and reads its first entries to confirm that the user can list it. To test again later, click Test connection in the connection's row.

To read from the folder that the server opens after sign-in (the login folder), leave Folder (optional) empty. Bobsled AI reads only inside the saved folder and skips links that point outside it.

Confirm the server's identity

Check server shows the Key type, Server software, SHA256 fingerprint, and MD5 fingerprint.

The SFTP connection form, with the server's key type, SHA256 and MD5 fingerprints, a matching owner fingerprint, and login settings.

To compare fingerprints, paste the owner's fingerprint into Fingerprint from the server's owner (optional). Bobsled AI then shows Fingerprints match or Fingerprints do not match. Both of the following forms work, with or without their SHA256: or MD5: labels:

  • SHA256, with or without the trailing =
  • MD5, with or without colons

If the fingerprints don't match, Trust this server is unavailable. A server usually has one host key for each key type, such as ssh-ed25519 and ssh-rsa, and presents only one of them to Bobsled AI. If the owner sent the fingerprint of another key type, it doesn't match. Ask the owner for the fingerprint of the key type that Key type shows.

If the owner can't give you a fingerprint, you can trust the key that Bobsled AI shows. Bobsled AI then detects any later change to that key.

How Bobsled AI pins host keys

Bobsled AI pins the key's type and its SHA256 fingerprint together. Connection tests, browsing, file reads, and pipeline runs ask the server only for pinned key types. They keep working if the server later adds a host key of another type.

Bobsled AI supports the following host key types: ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, and ssh-rsa.

Accept a changed host key

If the server presents an unpinned key, or stops offering the pinned key type, every test, browse, file read, and pipeline run stops. The error says that the identity of the server changed, or that the server no longer offers the trusted key type.

A changed key can mean that the owner replaced the key or moved the server. It can also mean that another server answered.

To accept a new key, do the following:

  1. Confirm the change with the server's owner.
  2. Open the connection, and then click Edit.
  3. Click Check server again.
  4. Compare the new fingerprint with the owner's fingerprint.
  5. Click Trust this server.
  6. Click Save changes.

Plan a key rotation

A connection can pin up to 4 host keys. If the owner announces a new host key before the switch, pin it next to the current key. The connection then keeps working through the change, because tests, browsing, Balto's file reads, and pipeline runs accept every pinned key.

To pin a new key, add the new key's type and fingerprint to hostKeys with the connections API. After the switch, remove the old key.

Browse the files

To browse the files, do the following:

  1. In the connection's row, open More actions, and then select Browse assets.
  2. Open a folder to see its files, sizes, and modified times. Bobsled AI lists folders first, and then files.

Browsing shows one folder at a time. A folder with more than 10,000 entries can't be browsed. Choose a subfolder.

Read files with Balto

Ask Balto to list the files on the connection and to read one. For example:

List the files in outbound/sales on Vendor SFTP and summarize the newest one.

Balto reads the same file formats as for Amazon S3 and Google Cloud Storage, up to 10 MiB for each file. Parquet files are the exception. Balto previews them up to 64 MiB.

Bobsled AI checks the file's size and modified time before and after each read. If either one changes, the file is probably still uploading. Wait, and then ask Balto to read it again.

When Balto lists files, it doesn't open folders that are links to other folders. To read files in a linked folder, give Balto that folder's path.

Query files with SQL

Balto can run SQL over CSV, JSON, Parquet, and Excel files on the connection, and join them with warehouse tables. An SFTP connection allows 2 file query downloads at the same time and 2 GiB in one query. This limit doesn't cover browsing, Balto's file reads, or pipeline runs. For formats, limits, and how Bobsled AI detects changed files, see Query files with SQL.

Load files with a pipeline

An extract pipeline loads a folder, one file, or the files that match a pattern into a warehouse table. Ask Balto to build the pipeline. For example:

Load the CSV files in outbound/sales on Vendor SFTP into the warehouse every four hours. Load only new files.

Balto reads a sample file, sets the format options, and adds the Blueprint files to a Draft. Review the Draft, validate it, save it, and publish it.

Blueprint files

A pipeline needs three Blueprint files. The examples in this section load the CSV files in outbound/sales/.

The integration file binds the pipeline source to the saved connection:

yaml
spec_version: "2" type: integration name: vendor_drop dogsled_connection_ref: vendor-sftp dogsled_source_kind: sftp

Set dogsled_connection_ref to the connection's slug. Bobsled AI makes the slug from the Display name: lowercase letters and numbers, with hyphens between words. For example, Vendor SFTP becomes vendor-sftp.

The Resource file describes one folder of files:

yaml
spec_version: "1" type: resource name: daily_sales integration: vendor_drop description: Daily sales files from the vendor. source: path: "outbound/sales/" format: csv compression: none options: header: true include_filename: true include_file_metadata: true replication: method: incremental_append cursor: field: last_modified tie_breaker: path schema_contract: evolve output: order_id: type: string sold_at: type: timestamp amount: type: number

The pipeline configuration schedules the extract:

yaml
type: pipeline_config destinations: warehouse: type: dogsled_managed dogsled_connection_ref: warehouse-prod pipelines: vendor_daily: type: extract source: vendor_drop destination: warehouse runner: managed schedule: every 4h resources: - resource: daily_sales

Replace the following:

  • warehouse-prod: the slug of your warehouse connection.

Resource paths

Write source.path relative to the connection's folder. If the connection has no folder, write it relative to the login folder. Use one of the following forms:

Path
Bobsled AI reads
outbound/sales/Every file in that folder and its subfolders.
outbound/sales/orders.csvThat one file.
outbound/sales/*.csvThe CSV files directly in that folder.
outbound/**/*.csvThe CSV files in outbound/ and all of its subfolders.

**/ also matches no folder, so outbound/**/*.csv includes the CSV files directly in outbound/. Validation rejects . and .. segments, backslashes, and paths that start with /. If a path doesn't exist on the server, the run fails.

Give each Resource files in one format: CSV, JSONL, or Parquet. For gzip files, set compression: gzip. When a Resource path is a folder, keep other files out of it. A text file in another format can still load as rows.

If Bobsled AI can't read one file, it skips that file and adds a warning to the run log. If the connection drops or the server stops responding for 60 seconds, the run fails. It doesn't skip the remaining files. Pipelines skip links and special files.

Replication

Choose the replication method that matches how the vendor writes files:

  • incremental_append: Use this method with the last_modified cursor when the vendor adds new files and never changes old ones. Each run loads only files that are newer than the last successful run and appends their rows to the table. If a file changes, the next run reads it again in full and appends its rows again.
  • full_refresh: Use this method when the vendor replaces files in place. Each run reloads every file in the folder.

IP allowlists

Some servers accept connections only from listed client IP addresses. To discuss network access for such a server, contact Bobsled AI support.

Fix a failed test

The test result names the cause. The following table lists each result and the action to take:

Result
Action
Bobsled AI could not find the hostCheck the host name.
The host points to a private network addressBobsled AI connects only to servers on the public internet. Use the server's public address.
The host has only IPv6 addressesBobsled AI needs an IPv4 address. Ask the owner for one.
The server refused the connectionCheck the port. SFTP usually runs on port 22.
The server did not answer, or closed the connectionCheck the host and port. If the server accepts only listed client addresses, see IP allowlists.
The port answers as an FTP serverBobsled AI supports SFTP. It doesn't support FTP or FTPS. Ask the owner for the SFTP port.
The port did not answer as an SSH serverAnother service, such as a web server, runs on that port. Ask the owner for the SFTP port.
The server offers only older algorithmsAsk the owner to enable current SSH algorithms.
The identity of the server changed, or it no longer offers the trusted key typeSee Accept a changed host key.
The server rejected the username or passwordCheck the username and the password secret.
The server rejected the private keyCheck the username. Ask the owner to add the key's public half for that user.
The server accepts only key loginChange Login method to Private key.
The server does not accept key loginChange Login method to Password.
The server asks for keyboard-interactive loginBobsled AI doesn't support this sign-in method. Ask the owner to allow password sign-in, or use a private key.
The private key is encryptedAdd the passphrase as a secret, and then select it in Passphrase secret (optional).
The passphrase does not open the private keyCheck the passphrase secret.
Bobsled AI could not read the private keyStore an OpenSSH, traditional PEM, or PuTTY version 2 key, including its first and last lines.
The private key is in PKCS#8 formatConvert it with ssh-keygen -p -f KEY_FILE, and then save the converted key as the secret.
The key is a PuTTY version 3 keyIn PuTTYgen, select Conversions > Export OpenSSH key, and then save the exported key as the secret.
The server does not offer SFTP to this userAsk the owner to enable SFTP for the user.
The folder does not existThe result shows the login folder. Correct Folder (optional).
The folder is a fileSet Folder (optional) to the folder that contains the file.
This user cannot read the folderAsk the owner to give the user read permission.

Limitations

SFTP connections have the following limitations:

  • Pipelines skip links and special files.
  • Balto reads files up to 10 MiB. Parquet previews go up to 64 MiB.
  • Browsing shows folders with up to 10,000 entries.
  • File queries read up to 2 GiB in one query, with 2 downloads at the same time on one connection.

For the protocols, sign-in methods, and network addresses that Bobsled AI supports, see Required server access.

What's next

On this page