Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a shell account (Debian) and I want all my localhost browser internet traffic to go through that shell account.

I know how to configure the internet browser and how to configure Putty for port forwarding, what I do not know is what I need to do on the server for this to happen.

Anyone knows what I should do on the server so that it will accept port forwarding? It does not seem to work with the default configuration.

share|improve this question
    
Are you using something like: ssh -l username -L localport:server:port sshserver? –  l0c0b0x Jun 11 '09 at 21:22
    
That is local port forwarding it will not allow the OP to tunnel all internet traffic, just the specified server will be browseable thru the tunnel created this way. The OP is probably looking for a SOCKS proxy which is perfectly doable with SSH –  Server Horror Jun 11 '09 at 22:11

4 Answers 4

Inside the sshd_config file just change the #PermitTunnel setting from no to yes.

from

#PermitTunnel no

to

PermitTunnel yes
share|improve this answer
2  
...and recycle sshd. –  David Mackintosh Jun 11 '09 at 22:04

I want all my localhost browser internet traffic to go through that shell account.

ssh -D 8080 -T -f -l username proxy_host
  • Will create a dynamic port forwarding (SOCKS proxy).
  • -T will not allocate a tty
  • -f will make SSH to go immediately into background
    • For this to work you need to use public key authentication
    • at least on debian have a look at ssh-copy-id
  • Now you just need to configure your browser to go thru the specified port

Leave out -Tand -f while testing the setup. The local port forwarding (-L [listenaddress]:localport:remotehost:remoteport ssh_host) will only work for the remotehost (e.g. ssh -L 8080:google.com:80 ssh_host will only forward traffic to google.com over the ssh_host not all web traffic)

If that doesn't work please update your question with the output of the SSH command with the -vvv switch added.

share|improve this answer

This article seems to have a lot of detail and should answer your question:

http://polishlinux.org/apps/ssh-tunneling-to-bypass-corporate-firewalls/

or there is always Wikipedia: http://en.wikipedia.org/wiki/Tunneling_protocol

share|improve this answer

I'd also recommend this: http://blog.slowb.ro/2013/06/21/create-a-ssh-based-vpn-system/

To summarise, parse -D [port] on to your ssh command, when making a connection. But the port must be on or above port 1025+.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.