• Support
  • Articles
  • Resources
  • Products

Tunnel through a tunnel

Moderator: boris

6 postsPage 1 of 1

AHinMaine
Newbie

Posts:
3
Joined: Sat Apr 23, 2005 4:35 am
by AHinMaine » Sat Apr 23, 2005 4:57 am
Former Tera Term user who hated giving it up when ssh1 got edged out.

To connect to my machine at my office, I have to jump through a firewall. I usually use the sshwin client and I create one window as a tunnel-only connection which forwards my local port 60022 to port 22 on my office pc. So then I open up a second window to localhost:60022 and I get all the benefits of a direct ssh connection. (The firewall squashes X traffic, for instance.)

Can I reproduce this in TT?

This is what I tried with LogMeTT, but it sort of hangs at the second screen. I can see the userid and passwd filled in, but I can't hit enter or Ok, even though I can click the radio buttons and disconnect button.

Code: Select all

connect 'firewall.example.com /ssh /2 /auth=password /user=$name$ /passwd=xxx'
setsync 1
settitle 'gw-tunnel'
testlink
if result=2 showtt 0
unlink
connect '127.0.0.1:60022 /ssh /2 /auth=password /user=$name$ /passwd=xxx'
setsync 1
settitle 'office'
Andy
AHinMaine
Newbie

Posts:
3
Joined: Sat Apr 23, 2005 4:35 am
by AHinMaine » Sat Apr 23, 2005 1:49 pm
Update:

I tried changing the LogMeTT script to this:

Code: Select all

connect 'firewall.example.com /f=tunnel.ini /ssh /2 /auth=password /user=$name$ /passwd=xxx'
unlink
connect '127.0.0.1 60022 /f=teraterm.ini /ssh /2'


First window logs in fine, the second window pops up the auth window where I can manually type the username and passwd, but again, I can't submit it. tunnel.ini is a copy of teraterm.ini with the added port fwd for 60022.
Andy

 

boris
Moderator, LogMeTT and TTLEditor developer

Posts:
1590
Joined: Sat Jan 08, 2005 2:52 pm
by boris » Sat Apr 23, 2005 2:18 pm
Hi Andy,

Have you tried to set up SSH port forwarding under "Setup" -> "SSH Forwarding" menu of TeraTerm? I never "played" with it myself but it can help resolving your problem.

I doubt that current version of Teraterm macro language understands port number in connect line other that :23, however the right person to answer this is Yutaka, who added SSH2 support to TeraTerm.

When using LogMeTT please keep in mind that when you execute the macro either from Configuration window or from pop-up menu, LogMeTT copies teraterm.ini file into Temp_TTL directory, then does modifications to the copied file (changes default colors) and executes Teraterm using this updated ini file from Temp_TTL. So, your attempt to use /f=tunnel.ini will most likely fail.

While waiting for Yutaka's comments on this, I would suggest you to try running your last macro from outside LogMeTT, and if that will work than I will start looking for the ways to add support of such functionality to LogMeTT.
Thanks.
Best regards,
Boris

 

Yutaka Hirata
TeraTerm Developer

Posts:
598
Joined: Wed Jan 12, 2005 2:35 pm
by Yutaka Hirata » Sat Apr 23, 2005 5:35 pm
Hi,

TeraTerm latest version doesn't support SSH2 port forwarding. Sorry.
Best regards, Yutaka Hirata
(yutakakn at gmail.com)
http://hp.vector.co.jp/authors/VA013320/

 

AHinMaine
Newbie

Posts:
3
Joined: Sat Apr 23, 2005 4:35 am
by AHinMaine » Sun Apr 24, 2005 2:28 pm
Oh ok. Does that also mean no X traffic as well?
Andy
stevo
Newbie

Posts:
19
Joined: Tue Oct 15, 2013 11:08 pm
by stevo » Tue Jan 17, 2017 2:23 am
I know this was 12 years ago...(!!!)...but did anything get sorted in more recent versions of LMTT or TT to support SSH tunnels?

I was doing it in a macro using the 'send' command to send the 'connect' string for each successive hop until reaching the end host.
But this is clunky and ugly, and makes macros longer than desired.
Given the way networks are being locked down more and more, the need for SSH tunnels has become far more prominent now - I need to use multi-hop ssh tunnels now (SSH in SSH in SSH!).

The ability to set this up so you can automatically 'chain' SSH connections together would be very useful indeed.
E.g.
LocalHost:ssh --> Jump1:ssh--> Jump2:ssh --> Host1:ssh
(SSH Client)

Or, to visualize the dependencies:

Code: Select all

  1.  
  2. LocalHost --> Host1:ssh
  3.     |
  4.     +-->Jump1:ssh     (to access Jump2, connect to Jump1)
  5.            |
  6.            +-->Jump2:ssh     (to access Host1, connect to Jump2)
  7.                   |
  8.                   +-->Host1:ssh
  9.  

I guess it's really just a loop that says:
(I know this is kind of ugly pseudo-code - I hope it's consistent enough to understand what I mean...)

Code: Select all

  1.  
  2.  if (session(host.port).jump = "jump1.port") {    ; that is, it's not NULL
  3.      if (session(jump1.port).jump = "jump2.port") {
  4.         if ...
  5.      } else {
  6.          connect(jump2.port);
  7.      }
  8.  } else {
  9.      connect(jump1.port);
  10.  }
  11.  connect(host.port);
  12.  

and it iterates for each session until it reaches a level where 'session(host.port).jump' is empty (no jump, direct connection).
Any thoughts or updates, Boris/Yutaka?
Display posts from previous:
Sort by:

6 postsPage 1 of 1

Users browsing this forum: No registered users
cron