I'm trying to use an SSH tunnel for a web proxy. I've done this sort of thing before (for games.) I fire up firefox and tell it to proxy through localhost 12345 for everything. Then, ssh user@host -L 12345:localhost:8080 -N. When I try to use the browser, I get "connection refused." I enabled all the flags in sshd_config and restarted. No idea how to proceed. HALP!

1 Answer 1


I think you are mixing up two commands. Try to set Firefox to Socks5 at port 12345 and run:

ssh user@host -D 12345

enter image description here

From the SSH manual, 'man ssh':

-D [bind_address:]port
Specifies a local “dynamic” application-level port forwarding. ... Currently the SOCKS4 and SOCKS5 protocols are supported, and ssh will act as a SOCKS server.

Your command user@host -L 12345:localhost:8080 -N forwards your local port 12345 to the remote host's port 8080. This would only work if there would actually be a proxy running on port 8080 on your remote host.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .