Skip to main content

Proxychains

proxychains-ng forces TCP applications to route through a proxy without changing each application's native proxy settings.

In this project, it is useful when a CLI tool (for example curl, git, ssh, or package managers) needs to reach internal resources through the same local SOCKS5 endpoint used by FoxyProxy.

Setup

Proxychains reads from a config file and wraps commands using proxychains4 <command>.

  1. Install proxychains.
## Fedora
sudo dnf install proxychains-ng -y

## Ubuntu / Debian
sudo apt update && sudo apt install proxychains4 -y
  1. Update /etc/proxychains.conf and change 3456 to your SOCKS proxy port, which is usually configured as DynamicForward in ~/.ssh/config.
sudoedit /etc/proxychains.conf
strict_chain
proxy_dns

[ProxyList]
socks5 127.0.0.1 3456
  1. Start your SSH SOCKS tunnel first (matching this docs set):
ssh -N example-network
  1. Run commands through the tunnel.
proxychains curl -I https://example.com
proxychains nc -vz -w 3 example.com 443

Notes

  • Use proxy_dns to avoid local DNS leaks when resolving internal hostnames.
  • Proxychains is best for TCP-based CLI traffic; browser traffic is usually easier with FoxyProxy.
  • If the command hangs, verify the SSH tunnel is running and listening on 127.0.0.1:3456.