Operating System - HP-UX
1846854 Members
2808 Online
110256 Solutions
New Discussion

Re: Openssh Daemon ignores Ctrl-C interrupt

 
Peter Kielbasiewicz
Frequent Advisor

Openssh Daemon ignores Ctrl-C interrupt

My compilation of openssh on HPUX 10.20 (3.6, 3.7 and 3.8) all ignore the
interrupt key (Ctrl-C).
In an archived discussion on http://marc.theaimsgroup.com/?l=openssh-unix-dev&r=1&w=2 I found that sshd inherits tty settings upon
invocation and thus has no setting for INTR when not started from a
regular shell.

Does someone have a solution to this problem?
How can I get sshd started at system boot so that it does not ignore
Ctrl-C?

3 REPLIES 3
Mark Grant
Honored Contributor

Re: Openssh Daemon ignores Ctrl-C interrupt

If sshd sets a signal handler to ignore SIGTERM then there isn't anything you can do about it.

WHy do you need to anyway?
Never preceed any demonstration with anything more predictive than "watch this"
Steven E. Protter
Exalted Contributor

Re: Openssh Daemon ignores Ctrl-C interrupt

check stty -a

You may have the squence blocked in stty setup or in /etc/profile .profile

This is not necessarily a bad thing.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Peter Kielbasiewicz
Frequent Advisor

Re: Openssh Daemon ignores Ctrl-C interrupt

Sorry, I think I need to clarify my request.
If sshd is started from an interactive shell, it inherits the 'intr' tty setting from this shell and thus an ssh-client connected to the daemon can use Ctrl-C to interrupt a command.

If sshd is started from an init script at system boot (which is what you want to do to have ssh capability) there is no tty associated with the init script and thus there is no tty setting for 'intr'.

So if you make an ssh connection to the daemon and you get a hanging command output you can not interrupt it but all you can do is to quit the ssh session.

If I would be able to attach a pseudo tty to the startup script I could use 'stty intr "^C"' and I would be done.