FileZilla (FTP): How to connect through tunnel

Grassroot Engineer
3 min readDec 5, 2024

--

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.
Normal SFTP config

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 port 3111 in localhost and port 22 in target.protected.machine .

For example in photo below, let me explain:

  1. 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 server sangfor_vm_bastion as an intermediate (bastion host) to connect to this private server.
  2. Connect FileZilla to localhost 3111 because any traffic sent to localhost:3111 will be forwarded securely to the private machine (192.168.1.65) on port 22222.
  3. In summary:
  • Maps your local port 3111 to the private server's port 22222.
  • Uses sangfor_vm_bastion as the bridge to access the private server.
  • Lets you connect to 192.168.1.65 (on port 22222) by connecting to localhost:3111.

You can then use tools like SFTP to interact with the private server as if it were directly accessible from your local machine.

Create tunnel in localhost and config FileZilla by localhost instead

Refs (notion):
https://superuser.com/a/1648935

If you think it’s useful for you, just clap your hands 👏 to be encouraged me.

GRASSROOT ENGINEER 😘

--

--

Grassroot Engineer
Grassroot Engineer

Written by Grassroot Engineer

ATM engineer who is interested in CODING and believe in EFFORT. — https://grassrootengineer.com

No responses yet