Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Linux and Unix
Tag Cloud
access audio black screen blue screen boot bsod connection crash dell desktop driver drivers dvd email error excel excel 2003 firefox hard drive hardware hdmi hijackthis internet keyboard laptop malware monitor motherboard network networking outlook problem recovery router screen slow sound spyware tdlwsp.dll trojan upgrade video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
socks4/5 proxy using ssh -D

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
Brin's Avatar
Senior Member with 102 posts.
 
Join Date: Mar 2005
10-Dec-2005, 04:00 PM #1
socks4/5 proxy using ssh -D
Hello,

I read that if I run the command in ssh then I can have a socks4/5 proxy on my 1080, for me to use:

ssh -D 1080 user@host

Im on windows xp and I cant run this on putty or on ssh?
I login to a shell account online and when I try to use host as the server that I logged into it doesnt accept connection.

Do I run that command in cmd? I'm having problems with cmd and trying to fix it so...

cmd or something else?

Thanks
Brin's Avatar
Senior Member with 102 posts.
 
Join Date: Mar 2005
11-Dec-2005, 06:27 AM #2
Is it even possible?
jiml8's Avatar
Senior Member with 1,513 posts.
 
Join Date: Jul 2005
Experience: I've been at this for too long.
11-Dec-2005, 08:43 AM #3
I don't understand what you are trying to do. If you do an ssh -D 1080 user@site.com then ssh will function as a socks proxy. You then have to set up your application to point its socks interface at localhost:1080.

Also, of course, site.com has to be running an ssh server.
Brin's Avatar
Senior Member with 102 posts.
 
Join Date: Mar 2005
12-Dec-2005, 09:39 AM #4
Ya, thats what I was saying.

My question one...Where do I type the "ssh -D 1080 user@site.com" ?

I have a socks account on 217.133.6.198

When I login and type "ssh -D 8128 onish@217.133.6.198" after the $ cursor thing, it says:
ssh: connect to host 217.133.6.198 port 22: Connection refused

Its a free shell account so maybe thats why. Or I'm typing it in the wrong spot, because I don't know anywhere else to type except after I login? If it'll work on a paid shell account, I can get one from fluidhosts.com...

Thanks! Hoping that this will work because I really want one

EDIT: I have managed to do this...
1.) connect to a shell
2.) connect to another shell using that command on port 8128
3.)put in password so that I'm not logged in the second shell where the first shell is like a "proxy"

But, I cant use localhost:8128 as a server nor first.shell:8128 as one either.

I think I have to run that command on my computer so only one connection to one shell is present?

But, I dont think windows has a command line interface...? Not sure if it'd work on cmd...I think it would if I put in a live cd for a linux OS or something...

Last edited by Brin : 12-Dec-2005 09:52 AM.
jiml8's Avatar
Senior Member with 1,513 posts.
 
Join Date: Jul 2005
Experience: I've been at this for too long.
12-Dec-2005, 11:50 AM #5
Quote:
Originally Posted by Brin

When I login and type "ssh -D 8128 onish@217.133.6.198" after the $ cursor thing, it says:
ssh: connect to host 217.133.6.198 port 22: Connection refused
This means that 217.133.6.198 does not have an ssh daemon watching port 22. If that host has sshd running, you will have to find out what port it is using and use the -P option on your ssh -D command. Alternatively, you will have to relay through another computer to the socks port on 217.133.6.198.

Yes, you do type the command ssh -D on the computer you are using as a client.

Quote:
EDIT: I have managed to do this...
1.) connect to a shell
2.) connect to another shell using that command on port 8128
3.)put in password so that I'm not logged in the second shell where the first shell is like a "proxy"

But, I cant use localhost:8128 as a server nor first.shell:8128 as one either.
None of this is clear. How, exactly, did you "connect to a shell"? From what computer to what computer using what command? How did you "connect to another shell..." using WHAT command? Again, from what computer to what computer using exactly what command line?

I don't understand your number 3 at all.

Quote:
I think I have to run that command on my computer so only one connection to one shell is present?

But, I dont think windows has a command line interface...? Not sure if it'd work on cmd...I think it would if I put in a live cd for a linux OS or something...
cmd doesn't support this stuff.

I use cygwin on Windows because I like the unix environment and with cygwin I get that, and I can use the bash shell. The commands you are entering here are strictly correct if you are using cygwin.

www.cygwin.com

If you want the windows-like interface, take a look at PuTTY. It will do what you want.

http://www.chiark.greenend.org.uk/~sgtatham/putty/

Again, this will only work if your destination box is running an ssh daemon (server). If it isn't you'll have to port forward through some other box that is running sshd.
Brin's Avatar
Senior Member with 102 posts.
 
Join Date: Mar 2005
12-Dec-2005, 01:58 PM #6
Thanks for the long post!

I think cygwin was what I was looking for. I have no idea how to ssh directly from my comp to my shell account using putty...

I had a live linux CD and I tested it on my laptop--I was able to SSH to my shell account. Directly from my computer to ssh. WHen I try the same thing on cygwin I cant do it because it doesnt have the ssh command. How do I install openssh so that it works with cygwin?

I searched for it in the package list search and found it but it wasnt anything to download...

Im looking through the setup tree but can't find ssh support.

So, how this works, I think...

I ssh to my shell account directly from my computer using cygwin using the following:

ssh -D 1080 user@host

then the socks5 server would be localhost:1080

Right?

Well, if it is correct, it should start working when we have ssh setup on cygwin

Thanks!
Squashman's Avatar
Distinguished Member with 14,983 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
12-Dec-2005, 02:14 PM #7
Quote:
Originally Posted by Brin
Thanks for the long post!

I think cygwin was what I was looking for. I have no idea how to ssh directly from my comp to my shell account using putty...
If it is a Windows box, just use putty.

Quote from Cygwin.
Quote:
Note that, when installing packages for the first time,h setup.exe does not select everything by default. Only the minimal base packages from the cygwin distribution are installed by default. When running setup.exe, clicking on categories and packages in the package installation screen will provide you with the ability to control what is installed or updated. Clicking on the "Default" field next to the "All" category will provide you with the opportunity to install every Cygwin package. Be advised that this will download and install hundreds of megabytes to your computer. The best plan is probably to click on individual categories and install either entire categories or packages from the categories themselves.
If ssh isn't in the default install, rerun the installer.
Brin's Avatar
Senior Member with 102 posts.
 
Join Date: Mar 2005
12-Dec-2005, 03:07 PM #8
Okay, Able to install ssh along with some other things... which got installed

So I try to use the same command and Im able to login to my shell account. Except, Im not connected to it using the port that I had specified. Could it be that the ports are already in use so that I get a different port? I mean, the ports that I get are sortta close to the one I was trying to connect to...



When I try to use localhost:connectedport I can't use it as a proxy...It says "Connection refused" I am on a wireless network which Is kind of messed up so that my ip on my little network and the main network im connected to is the same...

Maybe a problem there, so, if I plug my laptop into the LAN outlet it might work?

Well, I think we're almost there--Thanks much!

Last edited by Brin : 12-Dec-2005 05:36 PM.
Brin's Avatar
Senior Member with 102 posts.
 
Join Date: Mar 2005
13-Dec-2005, 09:53 AM #9
Eh?
jiml8's Avatar
Senior Member with 1,513 posts.
 
Join Date: Jul 2005
Experience: I've been at this for too long.
14-Dec-2005, 08:00 AM #10
Quote:
Originally Posted by Brin
Okay, Able to install ssh along with some other things... which got installed

So I try to use the same command and Im able to login to my shell account. Except, Im not connected to it using the port that I had specified. Could it be that the ports are already in use so that I get a different port? I mean, the ports that I get are sortta close to the one I was trying to connect to...
Don't worry about the internals. If you are connected that is all you need to worry about.

Quote:
When I try to use localhost:connectedport I can't use it as a proxy...It says "Connection refused" I am on a wireless network which Is kind of messed up so that my ip on my little network and the main network im connected to is the same...
I do not understand this paragraph. If you wish to have me comment on it you need to be specific. From where to where are you trying to use localhost:connectedport? Connection refused means wrong port or no server running, usually. What is your little network? What is the main network? What command did you run?

Please avoid posting screenshots; I couldn't read the ones you posted without considerable squinting and getting close to the screen.
Brin's Avatar
Senior Member with 102 posts.
 
Join Date: Mar 2005
14-Dec-2005, 03:29 PM #11
I was testing the socks5 server on FreeCap. After I connect to my shell account using ssh -D 8128

I use the "netstat" command from my computer to see which port I'm actually connected on because it never is the port that I choose...

I then see the port, 1093 (example) and then I add it to my FreeCap proxy list.

I then click on "test proxy" and it says connection refused on localhost:1093.

What I mean by saying little network was that I'm connected to the internet through a WAP therefore ports are messed up and you cant access my computer through WAP. (Wireless Access Point)

What could I be doing wrong?

thanks--
jiml8's Avatar
Senior Member with 1,513 posts.
 
Join Date: Jul 2005
Experience: I've been at this for too long.
14-Dec-2005, 10:57 PM #12
You are making this much too complicated. Forget netstat. Forget internal port assignments. Let the system handle those.

Is Freecap the server you want to connect to?

ssh -D 8128 is a syntax error and won't be accepted.

On what application are you clicking "test proxy"?

If you aren't clear, I can't help you. The syntax you want is ssh -D port user@server
Brin's Avatar
Senior Member with 102 posts.
 
Join Date: Mar 2005
15-Dec-2005, 05:41 AM #13
Freecap is a program that you can use certain programs through using a socks5 proxy.
You add the program (ex, IE) and then add the proxy server. I try to test the proxy server by clicking the test button on the program Freecap but it says connection refused.

I do use the syntax ssh -D port user@server
I type this syntax in Cygwin
Then I put in my password and I'm connected to my shell account

However, when I try to use my socks5 server as if its localhost: port
it doesnt work?
neaj's Avatar
Computer Specs
Junior Member with 1 posts.
 
Join Date: Jun 2008
Experience: Advanced
04-Jun-2008, 04:35 AM #14
I'm also trying this with no success.

I run this:
$ ssh -vvv -ND 9999 user@host

Firefox is configured to use localhost:9999 as socks proxy.

Each time I attempt to load a page in Firefox, ssh displays debug messages as follows:

"""
debug1: Connection to port 9999 forwarding to socks port 0 requested.
debug2: fd 6 setting TCP_NODELAY
debug2: fd 6 setting O_NONBLOCK
debug3: fd 6 is O_NONBLOCK
debug1: channel 2: new [dynamic-tcpip]
debug2: channel 2: pre_dynamic: have 0
debug2: channel 2: pre_dynamic: have 207
debug2: channel 2: zombie
debug2: channel 2: garbage collecting
debug1: channel 2: free: dynamic-tcpip, nchannels 3
debug3: channel 2: status: The following connections are open:

debug3: channel 2: close_fds r 6 w 6 e -1 c -1
"""

However no page loads. Firefox just stops loading, no message.
Closed Thread Bookmark and Share

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 12:31 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.