[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] ssh remote command

I've run into this alot when working with different versions of SSH, 
different architectures running SSH, and also mixing OpenSSH and the 
commercial SSH implementations.  In fact, I haven't been able to get the 
commercial version to work lately under Linux.  It will compile, 
install, and seem to work, but ssh connections fail with some terminal 
error.  I've ended up moving mostly to OpenSSH.  SSH'ing between the 
IRIX boxes and the Linux boxes will almost always exhibit this error 
when going from commercial SSH to OpenSSH.  I'm pretty sure I have 3.2.x 
as the commercial version but I don't know all the different OpenSSH 
versions on the different Linux boxes.

Keith Hopkins wrote:
> James P. Kinney III wrote:
>> What would cause an ssh tunneled command to no return when it finished?
>> ssh -f remotemachine /usr/local/mynewcommand.sh
>> mynewcommand.sh is a shell script that runs the ssh port tunnel followed
>> by the nc command to transport serial port over to ssh forwarded port.
>> It ends with
>> exit 0
>> What I see is the initial ssh never finishes and just sits there. I
>> thought once the command ran, it should terminate and the ssh closes. It
>> doesn't. puzzled.
>>  I stuck in some echo"" statement so I can see what is happening and
>> everything runs OK on the remote machine. 
> Good question James.  I've run into the same problem a couple of times.
> I've found two things that can help to get around the problem.
> The first is to redirect input from dev null.  so, your command becomes:
> ssh -f remote /usr/local/mynewcommand.sh <0 /dev/null
> The other is to batch the commands on the other end.  That is done 
> inside the the mynewcommand.sh script.
> 'atd' needs to be running for batch to work.
> $ batch <<EOF
> cmd1
> cmd2
> cmd2
> Batch launches a background job to run the commands, and immediately 
> returns.
> I've also run into occations where neither of these solutions work, 
> and haven't figured that one out yet.
> -- 
> Keith
>Ale mailing list
>Ale at ale.org