UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 4th, 2012, 10:59 PM
fuzzybunny's Avatar
fuzzybunny fuzzybunny is offline
C Neophyte.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Melbourne Australia
Posts: 403 fuzzybunny User rank is Sergeant Major (2000 - 5000 Reputation Level)fuzzybunny User rank is Sergeant Major (2000 - 5000 Reputation Level)fuzzybunny User rank is Sergeant Major (2000 - 5000 Reputation Level)fuzzybunny User rank is Sergeant Major (2000 - 5000 Reputation Level)fuzzybunny User rank is Sergeant Major (2000 - 5000 Reputation Level)fuzzybunny User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 1 h 34 m 55 sec
Reputation Power: 45
TCP port forwarding using SSH

I did a quick forum search but couldn't find an answer to this one

How do I enable port forwarding using SSH?

I have three devices

1- Desktop Computer
2- Server B (named bems)
3- Router C

I want to be able to ssh from computer to Router C , through Server B; hence I need to set up port forwarding on Server B

(see attached image file)


I have tried this but this does not work:
unix Code:
Original - unix Code
    server-b# ssh -L 2221:203.44.175.197:22 localhost



... I keep getting "Fatal error, connection refused"


Aside - Socat

I have socat partially working and ssh is forwarded,

but each time I run my script that automates SSH, it crashes...
unix Code:
Original - unix Code
    server-b# /opt/csw/bin/socat -ddd -v -ls -s -4 tcp-listen:2221 tcp-connect:203.44.175.197:22
Attached Images
File Type: jpg Drawing1.jpg (34.8 KB, 41 views)
__________________
For one to know everything, first one must accept he knows nothing.

Reply With Quote
  #2  
Old December 4th, 2012, 11:53 PM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Lost in code
Click here for more information.
 
Join Date: Dec 2004
Posts: 7,931 E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 2 Months 7 h 43 m 47 sec
Reputation Power: 6991
From desktop computer you would run this in one terminal:
Code:
desktop$ ssh -L 2221:routerc:22 serverb


Then in a second terminal on desktop computer you would run this:
Code:
desktop$ ssh -p 2221 localhost


Leave the first terminal open to maintain the tunnel. The second terminal will be connected to routerc through serverb.
__________________
PHP FAQ
How to program a basic, secure login system using PHP

Quote:
Originally Posted by Spad
Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > TCP port forwarding using SSH

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap