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
Yofi will provide the private key file. Save it securely on your local machine (e.g.,
~/.ssh/sftpuser_key).Set the correct file permissions to secure the key:
chmod 400 ~/.ssh/sftp_user_key
Step 2: Connect to the SFTP Server
Open your terminal.
Use the following command to connect to the SFTP server:
sftp -oPort=22443 -i ~/.ssh/sftp_user_key username@yofi_server_ipReplace
usernamewith the username provided by Yofi.Replace
your_server_ipwith the server's IP address provided by Yofi.
Once connected, you will see the
sftp>prompt, indicating a successful connection.
Step 3: Upload Files
Upload your file to the
/uploaddirectory on the server:put local_file_path /uploadReplace
local_file_pathwith the file's path on your local system.
Verify that the file was successfully transferred by listing files in the
/uploaddirectory:ls /upload
Step 4: Exit the Session
To exit the SFTP session, type:
bye4. 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
Generate an MD5 or SHA256 hash for your file locally:
md5sum local_file_path > local_file_path.md5or
sha256sum local_file_path > local_file_path.sha256Replace
local_file_pathwith the file's path on your system.
This will create a
.md5or.sha256file 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 /uploador
put local_file_path.sha256 /uploadStep 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
Download and install FileZilla from https://filezilla-project.org/.
Open FileZilla and go to File > Site Manager.
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).
Click Connect.
Option 2: Using Cyberduck
Download and install Cyberduck from https://cyberduck.io/.
Open Cyberduck and click Open Connection.
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).
Click Connect.
6. Troubleshooting Tips
Permission Denied Error: Ensure the private key file has
chmod 600permissions.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?
