How to create a SSH tunnel to encrypt a plain (insecure) ftp connection using FileZilla client & PuTTY
Summary:
- Filezilla FTP Client/Your local PC <~~ [Conn. 1] ~~> SSH server <~~ [Conn. 2] ~~> FTP server
Connection 1 is encrypted using the SSH protocol.
Caution: Connection 2 is not encrypted.
- Configure FileZilla to use your local PC as a (generic proxy) SOCKS 5 server.
- Configure PuTTY to create a SSH tunnel between your local PC and a SSH server using DYNAMIC port forwarding. In this mode, PuTTY acts as a proxy server.
The SSH server is a remote host that runs a SSH service (typically a Linux/Unix/BSD host). You must have an account to login to this host.
Configuration Procedure:
PuTTY configuration (for release 0.67 or similar):
Select "Category/Session"
Host Name: SSH Server IP number or name
Port: SSH server port number (22 by default)
Connection type: SSH
Select "Category/Connection/SSH/Tunnels"
Source Port: XXXX (5000 for instance, or any other unused high number)
Destination: (leave it empty)
Dynamic, Auto
FileZilla configuration (for version 3.46.3 or similar):
- Select "Edit/Settings/Connection/Generic proxy"
Type of generic proxy: SOCKS 5
Proxy host: localhost
Proxy port: XXXX (the SSH tunnel source port number, see PuTTY configuration above)
First execute PuTTY to create the desired SSH tunnel (you will be asked to provide username/password to login to the SSH server). Then execute Filezilla client using:
- Protocol: FTP - File Transfer Protocol
Host: FTP server IP number or name
Port: (leave it empty, 21 by default)
Encryption: Only use plain FTP (insecure)
Possible uses: your PC is on your home network, the SSH and FTP servers are behind your company's router/firewall, and:
- you cannot access the ftp server directly (external connections to the ftp server are blocked for security reasons), or
- you can access the ftp server directly but you don't want to send your data (username/password/files) without encryption over the internet.
See also:
https://documentation.help/PuTTY/using-port-forwarding.html
https://blog.devolutions.net/2017/4/how-to-configure-an-ssh-tunnel-on-putty
http://www.securebinary.co.za/ssh-port-tunneling-using-putty/
To save/load PuTTY configurations see:
https://documentation.help/PuTTY/config-saving.html
@Walmart The computer I want to connect to is only accessible through another server for security purposes. – Franck Dernoncourt – 2017-01-30T01:52:12.167
Too bad you couldn't just use WinSCP for that particular connection need rather than FileZilla then since you know it works. – Pimp Juice IT – 2017-01-30T03:25:48.647