LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-28-2014, 08:39 PM   #1
jddancks
LQ Newbie
 
Registered: Jan 2013
Location: Central NY
Distribution: Mac, debian
Posts: 29

Rep: Reputation: Disabled
Settings up ssh SOCKS proxy as a simple user on a network?


I try the following in my home directory on the institution server:

Code:
ssh -D 1166 localhost
Code:
ssh -D 1166 me@server.net
the last line in particular logs me in (it ssh's itself) due to public key authentication setup (oops)

This is the first time I've ever tried to make or use a proxy.

My instructor for a course I'm taking gave me the directions to use this. It appears I'm the only one having trouble with this and he doesn't know what I'm doing wrong.

FYI for browser use what browser on linux works the best for use a proxy.
 
Old 09-28-2014, 11:44 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

so you've created the proxy. Next step is to use it. Eg

Code:
chromium --proxy-server="socks://localhost:1166"
If this is not the information you are looking for please state what problem you are having.

Cheers,

Evo2.
 
Old 09-29-2014, 12:41 PM   #3
jddancks
LQ Newbie
 
Registered: Jan 2013
Location: Central NY
Distribution: Mac, debian
Posts: 29

Original Poster
Rep: Reputation: Disabled
It didn't work. I used as extra flag but I don't remember what. I think it may be cause I only have access to my account on the servers, so what would it be then?

When I tried the localhost command it didn't give me any errors on the server side. But it requires I keep the ssh session going from what I saw.

Is public key authentication necessary to connect to a proxy a password protected account on another account?
 
Old 09-29-2014, 07:21 PM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,
Quote:
Originally Posted by jddancks View Post
It didn't work. I used as extra flag but I don't remember what.
Make sure that all running instances of chromium have been stopped before launching it with the proxy option.
Quote:
Originally Posted by jddancks View Post
I think it may be cause I only have access to my account on the servers, so what would it be then?
You only need access to your account.

Hi,
Quote:
Originally Posted by jddancks View Post
When I tried the localhost command it didn't give me any errors on the server side. But it requires I keep the ssh session going from what I saw.
Not sure what "localhost command" you are refering to.

Quote:
Originally Posted by jddancks View Post
]
Is public key authentication necessary to connect to a proxy a password protected account on another account?
You don't normally need need any authentication to connect to a proxy. However you will need some sort of authentication to create the proxy.

Just to be clear this is what you should do. Open two terminals and then, in one of them do:
Code:
ssh -D 6667 me@server.somewhere
This will create the proxy and give you a shell on the remote server. After this leave that terminal alone with the shell connection open (other options can be passed to ssh to make it quietly go into the background be we can do that once we know we can get it to work).

In another terminal lauch your webbrowser after first making sure it is not running already:
Code:
killall chromium
chromium --proxy-server="socks://localhost:6667
If it "does not work" please be explicit about what happens.

Evo2.
 
1 members found this post helpful.
Old 10-01-2014, 07:59 AM   #5
jddancks
LQ Newbie
 
Registered: Jan 2013
Location: Central NY
Distribution: Mac, debian
Posts: 29

Original Poster
Rep: Reputation: Disabled
When I did the proxy command it actually logged me into the server.

I did this on my mac at home:
Code:
ssh -D 8888 me@server.edu
which sent me to the server and logged me in like a normal ssh session.

I tried using it on mac:

Code:
./"Google Chrome" --proxy-server="socks://me@server.edu:8888"
I got this in the error page in google chrome:

Code:
ERR_NO_SUPPORTED_PROXIES
-------

Your examples are really confusing. When I tried making a proxy at localhost, I did that on the server. The server doesn't have a browser installed. I need a proxy on the server to access local network webpages that I can't normally access offsite.

EDIT: I tried
Code:
ssh -D 8888 localhost
On the server side and that also didn't work

Last edited by jddancks; 10-01-2014 at 08:08 AM.
 
Old 10-01-2014, 09:36 PM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,
Quote:
Originally Posted by jddancks View Post
When I did the proxy command it actually logged me into the server.
Which is exactly what I said would happen.

Quote:
Originally Posted by jddancks View Post
I did this on my mac at home:
Code:
ssh -D 8888 me@server.edu
which sent me to the server and logged me in like a normal ssh session.
Good.
Quote:
I tried using it on mac:

Code:
./"Google Chrome" --proxy-server="socks://me@server.edu:8888"
I got this in the error page in google chrome:

Code:
ERR_NO_SUPPORTED_PROXIES
Um, hang on, is this "mac" the same machine on which you created the proxy with the ssh command? Also, that is not the correct argument. It shold be
Code:
--proxy-server="socks://localhost:8888

Quote:
Originally Posted by jddancks View Post
Your examples are really confusing.
You seem not to be following them.
Quote:
When I tried making a proxy at localhost, I did that on the server. The server doesn't have a browser installed. I need a proxy on the server to access local network webpages that I can't normally access offsite.
Why did you do that on the server? Just open the two shells on your client machine and run the two commands as I instructed in my last post. Change "me@server.somewhere" to whatever it needs to be, change 6667 to whatever high port number you like, do NOT change "localhost".

Evo2.




Evo2.
 
1 members found this post helpful.
Old 10-01-2014, 11:16 PM   #7
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
@Evo: From what I've gather after reading his comments 2 times... The mac is the client machine he want's connected to his network machine.. :P He just seems to be a bit confused of what actually happens when he runs those commands

@jddancks: What actually happens is that the SOCKS proxy is your personal mac machine (don't worry, the connection still gets routed via ssh on your workplace machine -- that's what the -D option does) and that's why you need to enter --proxy-server=socks://localhost:8888" (like Evo2 already told you to)...
It only seems weird because you're confusing the actual ssh connection with the socks proxy connection... You should think of them as two different things..

Basically, when running:
Code:
ssh -D 8888 me@server.edu:22
you are instructing your local (so, only localhost) machine to listen to incoming SOCKS4 or SOCKS5 connections on port 8888 that gets forwarded to me@server.edu:22
You will get connected and you need to keep this connection active (exiting will close the connection)

You then need to instruct your browser to connect to this localhost connection:
Code:
chrome ----proxy-server="socks://localhost:8888"

There is no need to run any kind of special command on the server side..

Last edited by Smokey_justme; 10-01-2014 at 11:18 PM.
 
1 members found this post helpful.
Old 11-23-2014, 02:47 PM   #8
jddancks
LQ Newbie
 
Registered: Jan 2013
Location: Central NY
Distribution: Mac, debian
Posts: 29

Original Poster
Rep: Reputation: Disabled
I couldn't get it to work with chrome but I got it to work with firefox (and the debian version of firefox).

Thanks to both evo2 and smokey_justme
 
  


Reply

Tags
socks, ssh


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Cant connect thru ssh socks proxy to certain sites postcd Red Hat 1 04-11-2014 01:55 PM
socks 5 to bypass proxy settings sulekha Linux - Networking 1 10-09-2010 03:21 PM
ssh socks proxy question redss Linux - Networking 1 02-27-2010 10:09 AM
ssh over socks proxy d0x++ Linux - Networking 1 06-03-2009 02:35 AM


All times are GMT -5. The time now is 06:34 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration