Re: Creating dynamic tunnels using bash script (cygwin/solaris)




Todd H. skrev:
galmok@xxxxxxxxx writes:
I am trying to create a tunnel via ssh from cygwin to solaris. Normally
I would do something like this (cygwin is my windows box having cygwin
installed and solaris is a solaris based server):

cygwin$ ssh -L5900:localhost:5900 solaris

My problem is that the destination port is unknown at the time I create
the ssh call. Only once I have logged in on solaris can I determine the
destination port.

Why is that? What is it you're forwarding? Perhaps there's another
way to go about it.

A VNC connection. Considering the user doesn't always know in advance
which port their vnc connection runs on, a script to find their display
has been created. And since it is possible to create port forwarding
dynamically using the escape commands, I wanted to create a
user-friendly way for users to launch a viewer to their vnc session.
Sequence of actions: Double-click icon, enter ssh password, enter vnc
password, ready to use.

Does anyone out there have a suggestion/solution?

The easiest way of course would be

ssh solaris "command to figure out what port you want"
ssh -L5900:localhost:thatport solaris

If typing the password becomes a chore, switch to public key auth and
use ssh-agent first to load your key into memory. After that, ssh
commands to solaris would pop through without a password prompt which
is kinda fun.

Yes, I have setup such a system (ssh-agent) for myself but can't expect
my users to do the same. Also, we have no control over the password (if
any) they chose to put on their local key. If they loose their laptop,
an intruder would have an easy time logging on to our system. And the
user would probably not inform us about the loss of their laptop and if
they ssh key was without a password.

But solaris prevents any stdout being sent back when a tty allocation
is forced. That is a huge showstopper. Also, the local cygwin openssh
client manages to redirect stdin from the pipe to the keyboard when
"~C" is sent via the pipe to ssh, making it difficult to enter
information to create the pipe.

I guess I may be able to use forward a fixed port for a particular user
(making sure each user has their own remote port) and have them make a
tunnel on the remote host to the desired port. Problem is that it
requires double the ports on the server and an tunnel program. It would
be nicer if dynamic port allocation could be programmatically achived
(contrary to interactive only as it is now).

.



Relevant Pages

  • Re: Creating dynamic tunnels using bash script (cygwin/solaris)
    ... ssh solaris "command to figure out what port you want" ...
    (comp.security.ssh)
  • Intermittent SSH failures from Cygwin
    ... I've hit a problem that only seems to occur when doing SSH from Cygwin ... I have a script that makes several connections from Cygwin to Solaris ... OpenSSL 0.9.7b 10 Apr 2003 ...
    (comp.security.ssh)
  • Creating dynamic tunnels using bash script (cygwin/solaris)
    ... I am trying to create a tunnel via ssh from cygwin to solaris. ...
    (comp.security.ssh)
  • Re: xhost +
    ... First I do xhost + on my linux, rlogin to solaris8, but my X server on linux is not listening on tcp ports, for security reasons. ... If you get ssh to your solaris, you must do ssh -XY susebox xterm, or you will get strange results since the terminal "Linux" is missing in Solaris. ... You can do another login at port 5802 and 5803. ...
    (alt.os.linux.suse)
  • Re: Creating dynamic tunnels using bash script (cygwin/solaris)
    ... I would do something like this (cygwin is my windows box having cygwin ... installed and solaris is a solaris based server): ... My problem is that the destination port is unknown at the time I create ... the ssh call. ...
    (comp.security.ssh)

Quantcast