Page cover

SFTP Data Transfer

Here’s the updated guide with the simplified verification process (listing files only) and a new section on creating and verifying hash files for data integrity:


Guide to Connecting to Yofi's SFTP Server

This guide provides detailed instructions for securely connecting to Yofi's SFTP server using the safest method—private key authentication. Follow the steps below to establish and test your connection.


1. Prerequisites

Before starting, ensure you have the following:

  • Access credentials provided by Yofi, including:

    • Server IP

    • Username

    • Private Key

  • A terminal application if connecting via the command line, or an SFTP GUI client like FileZilla or Cyberduck.


2. Why Private Key Authentication?

Private key authentication is the safest way to connect to SFTP servers. It eliminates the risks associated with passwords, such as brute-force attacks or password leaks, ensuring a highly secure connection.


3. Connecting Using the Terminal

Step 1: Save the Private Key to Your Machine

  1. Yofi will provide the private key file. Save it securely on your local machine (e.g., ~/.ssh/sftpuser_key).

  2. Set the correct file permissions to secure the key:

    chmod 400 ~/.ssh/sftp_user_key

Step 2: Connect to the SFTP Server

Not a 22-port used by Yofi in SFTP

  1. Open your terminal.

  2. Use the following command to connect to the SFTP server:

    sftp -oPort=22443 -i ~/.ssh/sftp_user_key username@yofi_server_ip
    • Replace username with the username provided by Yofi.

    • Replace your_server_ip with the server's IP address provided by Yofi.

  3. Once connected, you will see the sftp> prompt, indicating a successful connection.

Step 3: Upload Files

  1. Upload your file to the /upload directory on the server:

    put local_file_path /upload
    • Replace local_file_path with the file's path on your local system.

  2. Verify that the file was successfully transferred by listing files in the /upload directory:

    ls /upload

Step 4: Exit the Session

To exit the SFTP session, type:

bye

4. Verifying File Integrity with Hash Files

To ensure the uploaded files were transferred correctly, generate and upload a hash file along with your data file. Yofi will use the hash file to verify the data's integrity.

Step 1: Generate a Hash File

  1. Generate an MD5 or SHA256 hash for your file locally:

    md5sum local_file_path > local_file_path.md5

    or

    sha256sum local_file_path > local_file_path.sha256
    • Replace local_file_path with the file's path on your system.

  2. This will create a .md5 or .sha256 file containing the checksum of your data file.

Step 2: Upload the Hash File

Upload the hash file to the /upload directory:

put local_file_path.md5 /upload

or

put local_file_path.sha256 /upload

Step 3: Notify Yofi

Inform Yofi about the uploaded files and hash files so they can verify the integrity of the transfer.


5. Optional - Connecting with GUI Tools

Instead, if you prefer using GUI tools to connect with Yofi's SFTP server, here are some instructions.

Option 1: Using FileZilla

  1. Download and install FileZilla from https://filezilla-project.org/.

  2. Open FileZilla and go to File > Site Manager.

  3. Click New Site and configure the following:

    • Protocol: SFTP - SSH File Transfer Protocol

    • Host: your_server_ip (provided by Yofi)

    • Logon Type: Key file

    • User: username (provided by Yofi)

    • Key File: Browse to the private key file (~/.ssh/sftp_user_key).

  4. Click Connect.

Option 2: Using Cyberduck

  1. Download and install Cyberduck from https://cyberduck.io/.

  2. Open Cyberduck and click Open Connection.

  3. Configure the following:

    • Server: your_server_ip (provided by Yofi)

    • Username: username (provided by Yofi)

    • SSH Private Key: Browse to the private key file (~/.ssh/sftp_user_key).

  4. Click Connect.


6. Troubleshooting Tips

  • Permission Denied Error: Ensure the private key file has chmod 600 permissions.

  • Connection Timeout: By default, Yofi allows ONLY data transfer from your certain IP, Verify that the IP you are using is added to yofi settings.

  • Incorrect Key: Double-check that you are using the private key provided by Yofi.

For additional assistance, contact Yofi support and provide specific error messages for faster resolution.

Last updated

Was this helpful?