LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-22-2008, 03:03 PM   #1
joe2748
Member
 
Registered: Nov 2007
Distribution: Ubuntu 9.10
Posts: 36

Rep: Reputation: 15
how to use ssh to make a proxy server


From what I've read, it is possible to tunnel my http requests through any other machine that I have ssh access to? Is this right?
I'm trying it right now, with a command like this

ssh -D 8080 computer.atschool.edu -Nf -l myname

it appears to bind properly, no error messages. But, if I tell firefox to use localhost 8080 as the proxy server, nothing happens!

I try to browse to www.google.com, but no page shows up. No error, no nothing, no indication that the server was ever communicated with.
Any ideas?

Btw, I use firestarter, but have turned it completely off for this experiment.
 
Old 02-22-2008, 04:23 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
ok, well that seems ok so far. can you confirm how you're telling FF to use it? can you run a tcpdump or wireshark on lo to see the data going into the proxy port? have you tried it to other destinations? i'd wonder also if the remote daemon has been configured to remove those functions to prevent this being done.
 
Old 02-22-2008, 07:16 PM   #3
joe2748
Member
 
Registered: Nov 2007
Distribution: Ubuntu 9.10
Posts: 36

Original Poster
Rep: Reputation: 15
Well, now I am at home and tried doing the exact same command to my laptop at school. Same result. Everything appears to go ok, but no page appears when I try to go to a destination. I'm telling ff to use the proxy by going Edit-->Preferences-->Network-->Settings-->Manual Proxy Configuration.

I set the host to 127.0.0.1 and the port to 8080.

Will figure out how to do tcpdump in a minute or two.
 
Old 02-22-2008, 07:46 PM   #4
joe2748
Member
 
Registered: Nov 2007
Distribution: Ubuntu 9.10
Posts: 36

Original Poster
Rep: Reputation: 15
after looking into tcpdump, I tried the following command:
tcpdump port 8080

tcpdump faithfully sat there but recorded nothing, even after I switched firefox to use localhost 8080 as a proxy server.

When running tcpdump or tcpdump 80 I get lots of output, but nothing with tcpdump 8080.

interesting. Any ideas?
 
Old 02-23-2008, 01:56 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well are you actually defining it as the socks proxy or just the http proxy?

running "tcpdump port 8080" won't really help as it'll use eth0 by defualt. add "-i lo" to it for the loopback interface.
 
Old 02-23-2008, 10:35 AM   #6
joe2748
Member
 
Registered: Nov 2007
Distribution: Ubuntu 9.10
Posts: 36

Original Poster
Rep: Reputation: 15
Ok, sorry about that. Here is the output of tcpdump

joe@desktop:~$ sudo tcpdump port 8080 -i lo
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 96 bytes
10:31:00.361451 IP localhost.58404 > localhost.webcache: S 3572360087:3572360087(0) win 32792 <mss 16396,sackOK,timestamp 204806592 0,nop,wscale 6>
10:31:00.361837 IP localhost.webcache > localhost.58404: S 3562957621:3562957621(0) ack 3572360088 win 32768 <mss 16396,sackOK,timestamp 204806592 204806592,nop,wscale 6>
10:31:00.361877 IP localhost.58404 > localhost.webcache: . ack 1 win 513 <nop,nop,timestamp 204806592 204806592>
10:31:00.361897 IP localhost.58404 > localhost.webcache: P 1:555(554) ack 1 win 513 <nop,nop,timestamp 204806592 204806592>
10:31:00.361918 IP localhost.webcache > localhost.58404: . ack 555 win 530 <nop,nop,timestamp 204806592 204806592>
10:31:00.362143 IP localhost.webcache > localhost.58404: F 1:1(0) ack 555 win 530 <nop,nop,timestamp 204806592 204806592>
10:31:00.362289 IP localhost.58404 > localhost.webcache: F 555:555(0) ack 2 win 513 <nop,nop,timestamp 204806592 204806592>
10:31:00.362302 IP localhost.webcache > localhost.58404: . ack 556 win 530 <nop,nop,timestamp 204806592 204806592>

I can post output from more verbose commands if it will help, tell me what options to use.
I'm telling firefox to use 127.0.0.1 port 8080 as the http proxy, and then clicking the box underneath that says use this proxy server for all protocols.

Should I be clicking socks v4 or socks v5 ?
 
Old 02-23-2008, 10:56 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
yes, putty emulates a socks proxy, not an http proxy. only use the bottom box.
 
Old 02-23-2008, 11:17 AM   #8
joe2748
Member
 
Registered: Nov 2007
Distribution: Ubuntu 9.10
Posts: 36

Original Poster
Rep: Reputation: 15
Ah ha. Worked perfectly. Thanks a bunch!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing SSH from behind a proxy server rbkool Linux - Networking 3 08-25-2007 10:12 AM
Trying to SSH through a proxy server Scotteh Linux - Networking 10 05-31-2006 07:03 AM
SSH connection through companies proxy server rydl Linux - Networking 2 10-26-2005 09:08 AM
ssh/scp via a windows proxy server saleemlqorg Linux - Networking 2 01-09-2004 05:57 PM
how to ssh to Linux server via Win2K proxy wkuk Linux - Networking 2 04-23-2003 05:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration