LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 03-02-2010, 11:58 AM   #1
C4N4rD
LQ Newbie
 
Registered: Aug 2009
Location: San Francisco
Distribution: Free BSD
Posts: 4

Rep: Reputation: 0
Exclamation SSH reverse pipe


Hi There,

I want to install a packet(emerge) on my Gentoo, but it hasn't got access to Internet.

My client has access to internet and I can connect with SSH to the Gentoo. I want to do a reverse SSH pipe between my client and my Gentoo in order to give the access to Internet.

I'm trying this :
ssh -N -R 53:localhost:53 root@IP
ssh -N -R 21:localhost:21 root@IP

I configure this on my Gentoo side in the sshd_config :
PermitOpen 0.0.0.0:*
AllowTcpforwarding yes

But the emerge does not work anymore. I forget to do something, any help appreciate.

Thanks!
 
Old 03-02-2010, 12:40 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,373

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
The emerge? What's that got to do with SSH? And why would TCP DNS and FTP Control port access be any use? If you're trying to do DNS over it, then firstly you need UDP, not TCP, and SSH only does TCP tunnelling (not piping, pipes are very very different things). IF you do use DNS then the resulting DNS response means it's not going to use the tunnel for FTP, it's going to connect to the IP in the DNS response. And thirdly, FTP is NOT just port 21, you need to tunnel ports for FTP data as well as FTP control. You should just use HTTP really, much simpler on port 80.
 
Old 03-06-2010, 06:30 AM   #3
C4N4rD
LQ Newbie
 
Registered: Aug 2009
Location: San Francisco
Distribution: Free BSD
Posts: 4

Original Poster
Rep: Reputation: 0
So I should use emerge with the HTTP protocol.

But what I should use to give the access to my Gentoo to the Internet with HTTP? SSH I guess...
 
Old 03-06-2010, 09:19 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,373

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
HTTP is a better protocol, however you still can't make it work with a reverse SSH tunnel, as it'll only connect to port 80 of the ip defined as the destination of the pipe, and again as above you aren't doing anything in the first place to make emerge want to use the tunnel at all. Why would it connect to 127.0.0.1:80 when its trying to go to gentoo.example.com:80?
 
Old 03-07-2010, 01:34 AM   #5
C4N4rD
LQ Newbie
 
Registered: Aug 2009
Location: San Francisco
Distribution: Free BSD
Posts: 4

Original Poster
Rep: Reputation: 0
Why I do not want that it connects on 127.0.0.1:80 it's just because this device has not got access to internet, there is no route and I can't set a route... That's why I wanted to pass through my client.
 
Old 03-07-2010, 02:14 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,373

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
Yes i see that, but how do you intend to make that happen? It's fine making an ssh tunnel but if the client app isn't going to use it...
 
Old 03-07-2010, 12:29 PM   #7
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,094
Blog Entries: 2

Rep: Reputation: 111Reputation: 111
You could always use an ssh interface tap/tun device, then route the destination over that interface. Take a look at the -w option for ssh
 
  


Reply


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
Reverse Tunneling / Reverse port forwarding in SSH dynamics Linux - Networking 3 11-23-2009 10:31 AM
reverse ssh? slashcom Linux - Software 3 08-12-2004 10:51 PM
Reverse SSH Tunnel sniggleflop Linux - Security 1 10-13-2002 01:24 PM


All times are GMT -5. The time now is 12:00 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration