FileZilla (FTP): How to connect through tunnel
I think we know well about FileZilla this is a short summary.
What is FileZilla?
FileZilla is an FTP (File Transfer Protocol) client. In simple terms, it helps you send and receive files between your computer and a server over the internet. It works with different protocols like:
- FTP: The basic file transfer protocol.
- SFTP: Secure File Transfer Protocol for encrypted connections
(should always use) - FTPS: FTP with SSL encryption.
The best things are it’s completely free and works on Windows, macOS, and Linux.
Lets’ get to the point
1. How to connect normally
- Just define 6 things following in photo.
2. How to connect through tunnel
- Normally FileZilla are not allow to connect to Private IP or using Tunnel inside the app.
- But we can do following in Mac or Windows
ssh -L 3111:target.protected.machine:22 user1@gateway.public.com
And then use FileZilla to connect to localhost:3111
using credentials for target.protected.machine
- -L is “Local port forwarding”
-L [local_port]:[remote_host]:[remote_port]
- When run this command will tell
SSH
to create tunnel between port3111
inlocalhost
and port22
intarget.protected.machine
.
For example in photo below, let me explain:
ssh -L 3111:192.168.1.65:22222 sangfor_vm_bastion
This command creates a Local Port Forwarding connection using SSH. It allows your local computer to access a private server (192.168.1.65
) that is normally unreachable from your machine because it’s in a private network. You’re using the serversangfor_vm_bastion
as an intermediate (bastion host) to connect to this private server.- Connect FileZilla to
localhost
3111
because any traffic sent tolocalhost:3111
will be forwarded securely to the private machine (192.168.1.65
) on port22222
. - In summary:
- Maps your local port
3111
to the private server's port22222
. - Uses
sangfor_vm_bastion
as the bridge to access the private server. - Lets you connect to
192.168.1.65
(on port22222
) by connecting tolocalhost:3111
.
You can then use tools like SFTP to interact with the private server as if it were directly accessible from your local machine.
Refs (notion):
https://superuser.com/a/1648935