Configure Linux ( Ubuntu ) terminal to use socks proxy

2,623 views
Skip to first unread message

vinay kumar

unread,
Mar 14, 2015, 6:42:49 AM3/14/15
to lug...@googlegroups.com
Recent developments in IITR are well known. I have created a socks server in my laptop to tunnel http, https traffic. All applications are working fine. There is no need to login into websense if packets are tunneled through socks server. I cant able to configure terminal in ubuntu to use socks proxy.

If anyone know about it, please provide me with syntax.

Prakhar Singh

unread,
Mar 15, 2015, 12:38:19 AM3/15/15
to lug...@googlegroups.com
Open up a terminal and edit your .bashrc (eg $ nano ~/.bashrc):

Add the following lines:

export http_proxy='http://127.0.0.1:8123'
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy

Replace 'http://127.0.0.1:8123' accordingly.
Most programs look for the proxy variable. For example, curl would automatically use $http_proxy. There may be some which don't, for them you would have to configure the proxy specifically.

Restart your terminal (or use $ source ~/.bashrc)

Prakhar Singh

unread,
Mar 15, 2015, 12:44:40 AM3/15/15
to lug...@googlegroups.com
I forgot to add, if you want to keep these settings with sudo as well, edit the sudoers file ($ sudo visudo) and add:

Defaults env_keep += "http_proxy https_proxy ftp_proxy"

This retains the relevant variables. For security reasons, this isn't the default behaviour.

vinay kumar

unread,
Mar 15, 2015, 6:20:29 AM3/15/15
to lug...@googlegroups.com
What i have is SOCKS v5 proxy server. Am tunneling all my packets through SOCKS proxy.

My laptop -> SOCKS proxy installed on my laptop -> Campus websense HTTP proxy -> Internet.
It looks like they cant filter my traffic if i tunnel my connections through socks proxy.

I need syntax for SOCKS config. Not http. 

--
You received this message because you are subscribed to a topic in the Google Groups "Linux User Group,IITR" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lugiitr/MsThr7K_jW8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lugiitr+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Soumitr Pandey

unread,
Mar 15, 2015, 6:31:23 AM3/15/15
to lug...@googlegroups.com
Most terminal programs won't have support for socks proxies or tunneling. You'll need to use a different app to proxify your connection. Proxychains is pretty good at this.. 

You received this message because you are subscribed to the Google Groups "Linux User Group,IITR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lugiitr+u...@googlegroups.com.

Harshil Mathur

unread,
Mar 15, 2015, 6:44:39 AM3/15/15
to lug...@googlegroups.com
You can use http://www.delegate.org/delegate/SOCKS/. It is a Socks server/client that can listen as a http proxy. Thus, you can use it as SOCKS Proxy but your terminal can connect to it as a HTTP Proxy.

See the third answer at http://unix.stackexchange.com/questions/71481/use-socks-proxy-for-commands-in-terminal . Not exactly your use case but can be modified to meet yours.

Harshil Mathur

vinay kumar

unread,
Mar 15, 2015, 7:02:59 AM3/15/15
to lug...@googlegroups.com
Thanks. This does the work for me.

http://glug.nith.ac.in/blog/?p=149 ; This have clear explanation on how to use it.

vinay kumar

unread,
Mar 15, 2015, 7:06:50 AM3/15/15
to lug...@googlegroups.com
I dont think delegate can do the work. Am having trouble connecting ssh connections via websense proxy. 
Reply all
Reply to author
Forward
0 new messages