Re: ssh and netcat

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

 



On Tue, Oct 06, 2009 at 09:53:27AM +1100, Darren Tucker wrote:
> Josef Wolf wrote:
>> I can get rid of this error message by deleting the "exec" keywords from
>> the above script. But this effectively ignores the error.
>>
>> So the question is: what causes this "Killed by signal X"? Is it some sort
>> of incompatibility between ssh and netcat?
>
> The "outer" ssh command sends a SIGHUP to the proxycommand when it shuts 
> down (some versions of netcat don't check for the closure of their 
> stdin/stdout and would hang around forever).
>
> By default, if ssh is killed by a signal it reports which one, which is 
> what you're seeing (on Linux, 1=SIGHUP, 2=SIGINT).
>
>> Or am I using ssh and/or netcat
>> in a way it was not designed for? Any ideas how to properly get rid of this
>> error?
>
> You can either keep doing what you're doing (without the "exec", the ssh 
> command has a parent shell, and the shell catches the SIGHUP but it does 
> keep the shell process around for the duration of the connection) or tell 
> ssh to be quiet and not report the signal (change "exec ssh foo" to "exec 
> ssh -q foo").

Thanks for the description, Darren!

What would be the safe way when a real problem occurs? When I ignore the
error (either how I did it or by telling ssh to be quiet), will e.g. scp
properly report any problems?

In addition, I have one more problem with this setup: when I am localuser
on the local host and I try to connect as remoteuser like this:

  git clone ssh://remoteuser@xxxxxxxxxxx/some/repository

then it tries to go through the proxy as "localuser", only on the far end
it tries to login as "remoteuser".

So the question extends to: is there a way to find out from the proxycommand
as which user the connection should be done on the far end?

[Index of Archives]     [Open SSH Unix Development]     [Fedora Users]     [Fedora Desktop]     [Yosemite Backpacking]     [KDE Users]     [Gnome Users]

  Powered by Linux