Re: ssh and netcat



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").

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.



Relevant Pages

  • Re: Learning Lisp
    ... I compared VNC to SSH. ... Some programs can work only over VNC or a similar protocol, so I had a chance to compare these approaches. ... Let's say I need to check access rights on file /home/foo/bar.txt on server quux. ... This is what I would call 'doing it myself' -- I think of something, translate it to shell language, type and get results. ...
    (comp.lang.lisp)
  • Re: SFTP is not working
    ... When I try to use sftp or scp2, I get a message like this: ... sftp and scp2 both actually work by running ssh in a subprocess, ... The reason the shell startup files are relevant at all, ...
    (comp.security.ssh)
  • Re: Did you hack into my UNIX server Bible Bob?
    ... But that's not a shell question. ... >> OSX users, should I be using ssh instead of telnet for security? ... OSX as a built in firewall tab. ...
    (comp.unix.shell)
  • Re: "Driving" Linux Command Line from C# ?
    ... the usual Google search. ... Putty is great for manual work, but no API ... would be an SSH utility with an API but if it exists I haven't been ... Just be sure that you are sure about the shell on the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Execute and lock a user into a program upon login
    ... logs in to the box via SSH, a command is run, and they immediately get ... dropped into the environment that the command produces. ... user is dropped into the application 'vtysh' ... shell drops (ie. user does not have to exit the csh shell to drop the ...
    (freebsd-questions)