SFTP (SSH File Transfer Protocol) is a secure network protocol that allows you to access, transfer, and manage files over an encrypted SSH connection. Traditional FTP (File Transfer Protocol) uses clear-text to send commands and files over the connection, which makes sending sensitive files and credentials vulnerable to being seen by unwanted eyes. SFTP encrypts all commands and all files passed over the connection, ensuring confidentiality and integrity. As an encrypted connection, SFTP works on port 22 (by default) and supports strong authentication, such as passwords and SSH key pairs.

For every website owner, transferring files safely from a local machine to a remote server is very critical, as we all know. While FTP (File Transfer Protocol) remains a popular solution due to its simplicity, it has an obvious downside because it does not secure data with encryption. When you transmit files between your server and a local machine using FTP, typically your files and sensitive credentials are sent in clear text, exposing you to risk. Whereas SFTP (SSH File Transfer Protocol) tunnels FTP commands through a secure, SSH tunnel and protects data in transit.

In this guide, we are going to show you step by step how to connect your FTP server and more using the SFTP protocol, starting with how to choose a client and including some advanced automation tips. Whether you’re hosting a personal blog or an e-commerce portal that receives considerable traffic, following the best practices mentioned will allow you to keep your workflow streamlined and secure while using BigRock hosting services.

 

Why Use SFTP Instead of FTP?

  • Encryption: All commands and files are encrypted, thwarting eavesdroppers.
  • Authentication: Supports SSH key pairs for password-less logins and enhanced security.
  • Single Port: Uses port 22, simplifying firewall configuration and reducing open ports.
  • Data Integrity: Built-in checks verify files aren’t corrupted or tampered with during transfer.
Pro Tip: If you’re running a high-security environment, use SSH keys only. Disable password authentication in your SSH server config (/etc/ssh/sshd_config) to prevent brute-force attacks.

Prerequisites

Before you begin, ensure you have:

  • An active BigRock hosting account with SSH/SFTP enabled
  • An SFTP client installed (e.g. FileZilla, WinSCP, Cyberduck).
  • Your SFTP credentials:
  • Host: Your domain (e.g. ftp.yourdomain.com) or server IP.
  • Username and Password (or SSH private key).
  • Port: 22 (default for SFTP)
Also Read: What Is File Transfer Protocol (FTP)?

Step-by-Step Guide: How to Connect FTP Server via SFTP

1. Install and Open Your SFTP Client

  • FileZilla (Windows/Mac/Linux)
  • WinSCP (Windows)
  • Cyberduck (Mac/Windows)

2. Retrieve Your SFTP Credentials

  1. Log in to your BigRock cPanel.
  2. Navigate to FTP Accounts under the Files section.
  3. Note your username, password (or generate SSH keys), and host name.

3. Configure the Connection in FileZilla

  1. Open FileZilla and go to File > Site Manager.
  2. Click New Site, name it “BigRock SFTP”.
  3. Set Protocol to SFTP – SSH File Transfer Protocol.
  4. Enter your Host and Port 22.
  5. Choose Logon Type:
    • Normal for username/password.
    • Key file if using an SSH private key.
  6. Enter Username and Password (or browse to your private key).
  7. Click Connect.

4. Transfer Files Securely

  • Local pane (left): Your computer’s files.
  • Remote pane (right): Server directories.
  • Drag & drop to upload/download.
  • Right-click files to set permissions (e.g. 755 for scripts, 644 for HTML/CSS).

Security Best Practices

  1. Use Strong Passwords or SSH Keys
    • Passwords should be ≥ 12 characters with mixed types.
    • SSH keys (2048-bit or higher) offer superior security.
  2. Disable Unused Protocols
    • In your SSH config (/etc/ssh/sshd_config), disable FTP and password authentication if you only need SFTP.
  3. Limit User Access
    • reate separate SFTP-only users with ChrootDirectory restrictions to prevent directory traversal.
  4. Rotate Credentials Regularly
    • Schedule monthly password or key rotations and revoke old keys.
Pro Tip: To further optimise performance, enable compression in your SSH client settings (e.g. FileZilla’s “Enable compression” option) for faster transfers over slow networks.

Troubleshooting Common Issues

  1. Connection Refused
    • Verify SSH/SFTP is running on your server (systemctl status sshd).
    • Ensure port 22 is open in your firewall (ufw allow 22/tcp).
  2. Authentication Failed
    • Double-check username, password, and key permissions (chmod 600 ~/.ssh/id_rsa).
    • Confirm your public key is in ~/.ssh/authorized_keys.
  3. Permission Denied
    • Ensure your SFTP user has the correct ownership and file permissions.
    • Check ChrootDirectory settings if using jail environments.
  4. Slow Transfers
    • Enable SSH compression and verify server load.
    • Use parallel transfers (multiple simultaneous file streams) if your client supports it.
Also Read: FTP vs. SFTP: What is the Difference?

Advanced Tips

Automate SFTP with Scripts

For routine backups or deployments, scripting SFTP sessions saves time:

bash

CopyEdit

#!/bin/bash

HOST=’ftp.yourdomain.com’

USER=’username’

KEY=’/home/you/.ssh/id_rsa’

LOCAL_DIR=’/path/to/local’

REMOTE_DIR=’/path/to/remote’

 

sftp -i $KEY -P 22 $USER@$HOST <

cd $REMOTE_DIR

put -r $LOCAL_DIR/*

bye

EOF

 

  • Save as deploy.sh, make executable (chmod +x deploy.sh), and run (./deploy.sh).

Integrate with CI/CD

  • Many CI/CD platforms (e.g. GitHub Actions, GitLab CI) support SFTP uploads.
  • Store keys as encrypted secrets and add an SFTP step in your pipeline.

Conclusion

Understanding how to connect an FTP server via SFTP is essential for any website owner who is serious about security. With BigRock’s dependable hosting—featuring built-in SSH access and round-the-clock support—you can confidently manage your files, automate deployments, and safeguard your data. Follow this guide to switch from unsecured FTP to robust SFTP in minutes, and take advantage of BigRock’s affordable, reliable hosting solutions.

Ready to Enhance Your Security? Explore BigRock’s Shared Hosting and VPS Hosting plans today!