wrapper script to use cvs/scp through a ssh gateway
From: bearclaw (bearclaw_at_free.fr)
Date: 09/28/05
- Next message: Nico Kadel-Garcia: "Re: ssh config"
- Previous message: semovrs_at_concord.edu: "takes longer and longer for next prompt to come with every unsuccessful login attempt"
- Next in thread: Darren Tucker: "Re: wrapper script to use cvs/scp through a ssh gateway"
- Reply: Darren Tucker: "Re: wrapper script to use cvs/scp through a ssh gateway"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 28 Sep 2005 00:01:57 +0200
I'm trying to write a ssh-wrapper program to be able to use cvs, scp...
through an ssh gateway, but ran into trouble.
Here is the situation (in case "ssh gateway" is not clear enough):
>From home, to reach lab1.lab.com through ssh, I have to do
$ssh -t user@gateway.lab.com lab1
Then I have to type my password twice (once for the ssh on the gateway, the
second time for the ssh on lab1).
Of course I can't run cvs or scp through this, the only way I have now is to
do my ssh through the gateway, then do a ssh from lab1 to home (which I can
do directly) with a tunnel to forward a random port to the sshd port on
lab1...
My idea was to write a progam that would be called instead of ssh by the
application and would:
-change the ssh command line "ssh args host command" to "ssh args -t -t
gateway host echo magicstring && command
-invoke ssh as a child process
-while the magicstring is not received
-read from the tty and send everythong to ssh
-send everything from ssh to tty
-when the magic string is received
-just bridge ssh and the client app
The double -t is required, otherwise I can't type in the second password.
However, this leads to two problem:
-everything that ssh receives is echoed back
-\n are changed to \r\n
for instance typing "echo a |sshwrapper lab1 cat" will print back
a\r\na\r\n
An ugly hack can get rid of the echo, but there is no way to solve the \r\n
problem.
So, is there a way to supress the echo/ \r\n transformation? I think this is
related to the use of -t -t, but unless I can convince my sysadmins to
allow the use of ssh keys I will need this options to type my password.
Hope I was clear enough :)
bearclaw
- Next message: Nico Kadel-Garcia: "Re: ssh config"
- Previous message: semovrs_at_concord.edu: "takes longer and longer for next prompt to come with every unsuccessful login attempt"
- Next in thread: Darren Tucker: "Re: wrapper script to use cvs/scp through a ssh gateway"
- Reply: Darren Tucker: "Re: wrapper script to use cvs/scp through a ssh gateway"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|