LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-08-2014, 03:33 PM   #1
steve51184
Member
 
Registered: Dec 2006
Posts: 381

Rep: Reputation: 30
anyway to tunnel all network traffic of a single app via an ssh?


i have an ssh tunnel setup fine but i wan't to be able to send all traffic from one app through it.. can it be done?
 
Old 03-10-2014, 01:02 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

Quote:
Originally Posted by steve51184 View Post
i have an ssh tunnel setup fine but i wan't to be able to send all traffic from one app through it.. can it be done?
yes. For this I use socks proxy over ssh (-D option), and proxychains for the client program.

Eg.
Create the tunnel
Code:
ssh -f -N -D localhost:5555 myserver.some.where
Configure proxychains
Code:
echo 'socks4 127.0.0.1 5555' >> /etc/proxychaings.conf
Use the tunnel with some program
Code:
proxychains someprogram
HTH,

Evo2.
 
1 members found this post helpful.
Old 03-10-2014, 01:04 AM   #3
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

one more thing, you don't need root for this since proxychains will also look for a config file in ~/.proxychains.conf

Evo2.
 
Old 03-10-2014, 11:29 AM   #4
steve51184
Member
 
Registered: Dec 2006
Posts: 381

Original Poster
Rep: Reputation: 30
hmm tried that but just can't seem to get it to work
 
Old 03-10-2014, 07:24 PM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by steve51184 View Post
hmm tried that but just can't seem to get it to work
can you be more specific?

Evo2.
 
Old 03-10-2014, 07:38 PM   #6
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by steve51184 View Post
hmm tried that but just can't seem to get it to work
copy paste with code flags what you did and what happened directly from the CLI.
 
Old 03-10-2014, 10:56 PM   #7
steve51184
Member
 
Registered: Dec 2006
Posts: 381

Original Poster
Rep: Reputation: 30
i ran the following command to open the socks proxy on port 5555:

Code:
ssh -f -N -D localhost:5555 server.ip
i then saved the following in /etc/proxychains.conf (well i edited the old config to remove the default tor line etc):

Code:
socks4 127.0.0.1 5555
i then ran the following (just a test i know it can be done within chrome much better etc):

Code:
proxychains /usr/bin/google-chrome-stable
all i get is 'This web page is not available' via chrome (and likewise other apps also have no internet access)

this is the output via command line for the above command: http://pastie.org/pastes/8906135/tex...utkrtjfznfd2bw

Last edited by steve51184; 03-10-2014 at 10:58 PM.
 
Old 03-10-2014, 11:20 PM   #8
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

ok from the pastebin I can see that libproxychains.so.3 is not being found. Was ldconfig run by the postinstall script? If not please try running it now (as root). You may also need to log out and back in again (but I'm just guessing here).

If the above fails then _instead_ of running the proxychains script do:
Code:
export LD_PRELOAD=/usr/lib/libproxychains.so.3
someprogram
The only difference between this and using the proxychains script is that the full path is specified for LD_PRELOAD.

Evo2.
 
Old 03-10-2014, 11:32 PM   #9
steve51184
Member
 
Registered: Dec 2006
Posts: 381

Original Poster
Rep: Reputation: 30
/usr/lib/libproxychains.so.3 isn't on my system? :/
 
Old 03-10-2014, 11:50 PM   #10
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

what is the output of the following?
Code:
find /usr/lib -name libproxychains.so.3
Evo2.
 
Old 03-10-2014, 11:50 PM   #11
steve51184
Member
 
Registered: Dec 2006
Posts: 381

Original Poster
Rep: Reputation: 30
/usr/lib/x86_64-linux-gnu/libproxychains.so.3
 
Old 03-10-2014, 11:52 PM   #12
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

ok, so use that path.

Evo2.
 
Old 03-10-2014, 11:53 PM   #13
steve51184
Member
 
Registered: Dec 2006
Posts: 381

Original Poster
Rep: Reputation: 30
sorry to sound dumb but what do i do with the following? :/

Code:
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libproxychains.so.3
COMMAND
 
Old 03-10-2014, 11:56 PM   #14
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

run it in a terminal replacing "COMMAND" with whatever command you want to run eg chrome-chrome-stable. Look at the contents of /usr/bin/sockproxy to understand why.

Evo2.
 
Old 03-10-2014, 11:59 PM   #15
steve51184
Member
 
Registered: Dec 2006
Posts: 381

Original Poster
Rep: Reputation: 30
/usr/bin/sockproxy is empty :/

also same problem no internet access for the app although the libproxychains.so.3 error is gone:

Code:
[22084:22134:0311/045814:ERROR:download.cc(356)] PostClientToServerMessage() failed during GetUpdates
[22084:22084:0311/045814:ERROR:CONSOLE(0)] "Application Cache Error event: Manifest fetch failed (-1) https://www.google.co.uk/_/chrome/newtab/manifest?espv=2&ie=UTF-8", source: https://www.google.co.uk/_/chrome/newtab?espv=2&ie=UTF-8 (0)
[22084:22084:0311/045815:ERROR:CONSOLE(0)] "Error in event handler for (unknown): TypeError: Cannot read property 'debug' of undefined
    at chrome-extension://dhnaagndnllbblbgeimdkknegobbpohk/imagezoomer.js:35:23
    at disconnectListener (extensions::messaging:338:9)
    at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14)
    at Event.dispatchToListener (extensions::event_bindings:394:22)
    at Event.dispatch_ (extensions::event_bindings:378:27)
    at Event.dispatch (extensions::event_bindings:400:17)
    at dispatchOnDisconnect (extensions::messaging:293:27)", source: https://www.google.co.uk/_/chrome/newtab?espv=2&ie=UTF-8 (0)
 
  


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
route http and ssh traffic normally, everything else via vpn tunnel normadize Linux - Networking 0 10-20-2013 05:44 PM
Making a Linux gateway ssh to tunnel the traffic iamomen Linux - Networking 1 10-06-2010 12:31 AM
SSH Tunnel - Record Traffic through Server thegondola Linux - Networking 1 05-20-2010 01:17 PM
SSH Tunneling - How do you tunnel traffic? SheMoves Linux - Newbie 1 07-26-2008 03:42 PM
Block certain traffic when using SSH Tunnel? lolmannz Linux - Software 5 07-05-2008 07:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:24 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