Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

andyandy's avatar

Can i use Ubutnu server as a FTP proxy?

I need to connect to FTP account in country XYZ. But provider by default is limiting access to FTP only from that country. However I own a server (Ubuntu 18.04) in that country.

Could use my server as a proxy by installing something and connecting through it?

Unfortunately I have little success finding any info on Google.

0 likes
5 replies
andyandy's avatar
andyandy
OP
Best Answer
Level 4

I figured it out. I need SOCKS5. And I solved it by installing Dante.

# or download latest dante-server deb for Ubuntu, works for 16.04 and 18.04:
wget http://archive.ubuntu.com/ubuntu/pool/universe/d/dante/dante-server_1.4.2+dfsg-2build1_amd64.deb

# and install it:
sudo dpkg -i dante-server_*.deb


# open dante config for editing:
sudo nano /etc/danted.conf

# remove everything (holding Ctrl+K will do it) and copy-paste basic config:
# /etc/danted.conf

logoutput: syslog
user.privileged: root
user.unprivileged: nobody

# The listening network interface or address.
internal: 0.0.0.0 port=1080

# The proxying network interface or address.
external: eth0

# socks-rules determine what is proxied through the external interface.
# The default of "none" permits anonymous access.
socksmethod: username

# client-rules determine who can connect to the internal interface.
# The default of "none" permits anonymous access.
clientmethod: none

client pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: connect disconnect error
}

socks pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: connect disconnect error
}

# end of config

# add system user 'proxyuser' with password to use with sock5 auth:
sudo useradd --shell /usr/sbin/nologin proxyuser
# or:
# sudo adduser --system --no-create-home --disabled-login --group proxyuser
sudo passwd proxyuser
# and input desired password twice

# if you use ubuntu firewall, allow ports:
sudo ufw allow 1080

# restart dante and enable starting on boot:
sudo systemctl restart danted
sudo systemctl enable danted

# you may see dante status:
sudo systemctl status danted

Then you just go inside FTP client into proxy settings, choose SOCKS5 fill in user/password that you set up above and it is done.

If you have problems connecting to some servers just choose SFTP (in settings of FTP connection of problematic server)

andyandy's avatar

Little I can do, project to work on came with FTP access.

andyandy's avatar

Client has FTP only.

I'm using my own server in that country as proxy to connect to his FTP.

Please or to participate in this conversation.