SFTP (Secure File Transfer Protocol) allows you to transfer files between your local computer and your VPS securely over SSH. It works similarly to FTP but adds an extra layer of encryption.
This guide will show you how to connect to your VPS using SFTP on different platforms.
Requirements
Before getting started, make sure you have:
• Your VPS IP address
• Your SSH username (typically root)
• Your SSH password or private key
• An SFTP client:
• Windows: WinSCP, FileZilla, or Cyberduck
• macOS: Cyberduck or Transmit
• Linux/macOS/Windows: You can also use the Terminal with the sftp command
Method 1: Connect Using WinSCP (Windows)
1. Download and install WinSCP
Visit https://winscp.net and download the installer.
2. Launch WinSCP
In the login window, enter the following:
• File protocol: SFTP
• Host name: Your VPS IP address
• Port number: 22
• Username: root
• Password: Your VPS root password
3. Click “Login”
The first time you connect, accept the server’s host key. You will then see your VPS file system on the right, and your local files on the left.
4. Transfer Files
Drag and drop files between panes to upload or download.
Method 2: Connect Using FileZilla (Windows/macOS/Linux)
1. Download and install FileZilla
Go to https://filezilla-project.org and install the FileZilla Client.
2. Open FileZilla
In the top bar, enter:
• Host: sftp://your_server_ip
• Username: root
• Password: Your VPS root password
• Port: 22
3. Click “Quickconnect”
Accept the server key if prompted. You’ll now be connected and can transfer files between your computer and VPS.
Method 3: Use SFTP from the Terminal (Linux/macOS/Windows)
1. Open Terminal or Command Prompt
• On Windows, use PowerShell or Windows Terminal.
• On macOS or Linux, use the Terminal.
2. Run the SFTP command:
sftp root@your_server_ip
3. Enter your password when prompted.
4. Use basic commands to transfer files:
• ls – list files on the VPS
• lcd – change local directory
• cd – change remote directory
• put filename – upload a file
• get filename – download a file
• exit – close the session
Example:
put myfile.zip
get backup.sql
Optional: Use SSH Key Authentication
If your VPS uses SSH key authentication, configure your SFTP client to use your private key file (e.g., id_rsa). Most GUI clients like WinSCP and FileZilla support key-based login.
Troubleshooting
• Connection refused or timeout:
• Ensure your VPS is online and SSH service is running.
• Make sure port 22 is open and not blocked by a firewall.
• Authentication failed:
• Double-check your login credentials.
• Make sure your IP is not blocked due to too many failed login attempts.
• Permission denied during upload:
• Make sure you’re uploading files to directories where root has write access.
• Alternatively, use the /root directory or set appropriate permissions.
Conclusion
Using SFTP is a secure and easy way to manage files on your VPS. Whether you prefer a graphical client or the command line, SFTP ensures that your data is encrypted during transfer.
For further assistance, feel free to contact Hosteons Support.