Re: HP-UX: ssh connections ignore CTRL+C interrupts

peter.kielbasiewicz_at_philips.com
Date: 03/11/04

  • Next message: Patrick Colony: "Re: openssh-3.7.1p2 & openssh-3.8p1"
    To: Bob Rasmussen <ras@anzio.com>
    Date: Thu, 11 Mar 2004 15:00:51 +0100
    
    

    Hello Bob,

    now I see the point. You are telling me that the client should tell the
    daemon what the interrupt key is.
    It seems that this does not work on HPUX.
    When I ssh from HPUX to another HPUX box and I type 'stty' I get the
    following:

    # stty
    speed 9600 baud; evenp hupcl
    intr = ^C; erase = ^H; kill = ^U;
    ....

    Intr seems to be set but Ctrl-C does not work.
    When I type 'stty sane' and then 'stty' the intr setting is gone.
    # stty sane

    # stty
    speed 9600 baud; evenp hupcl
    eol2 = ^@; swtch = ^@;
    ....

    Now I do 'stty intr "^C"' and stty which says intr is set now, but still
    Ctrl-C does not work.
    The only way to Ctrl-C working is to start the sshd from an interactive
    shell where Ctrl-C is already set.

    # stty intr "^C"
    # stty
    speed 9600 baud; evenp hupcl
    intr = ^C;
    eol2 = ^@; swtch = ^@;
    ...

    --
    best regards
      Peter Kielbasiewicz
     
     
    ____________________________________________________________________________
       Philips Medizin Systeme Böblingen GmbH
       Peter Kielbasiewicz Phone:  +49 (7031) 463-1893
       Building 5 CMS-B IT (2C9)                                       FAX : 
    +49 (7031) 463-2944
       Hewlett-Packard-Strasse 2 
       71034 Boeblingen e-mail:  Peter.Kielbasiewicz@philips.com
     
    ____________________________________________________________________________
      Jochen M. Franke, Dr. Werner Haas (Sprecher), David Russell, Wolfgang 
    Strenzl
      Sitz der Gesellschaft: Böblingen
      Registergericht Böblingen Reg.-Nr. HRB 5187
    Bob Rasmussen <ras@anzio.com>
    10.03.2004 15:54
     
            To:     Peter Kielbasiewicz/BBL/MS/PHILIPS@EMEA1
            cc:     secureshell@securityfocus.com
            Subject:        Re: HP-UX: ssh connections ignore CTRL+C interrupts
            Classification: 
    On Wed, 10 Mar 2004 peter.kielbasiewicz@philips.com wrote:
    > I think my issue needs some clarification.
    > When I start sshd from an interactive shell, everything works fine.
    > My shell has "stty intr '^C'" and thus the sshd inherits this setting so
    > that all ssh clients connecting to it can use Ctrl-C for interrupting
    > processes.
    > The issue is that at system boot sshd is started from a startup script 
    run
    > by init and not from a tty.
    > If I add an stty command to this script I get an error telling me that
    > there is no tty.
    > Because the startup script has no tty it has no setting for 'intr' and 
    so
    > Ctrl-C does not work.
    > This can be very awkward if you have a hanging command and the only 
    thing
    > you can do then is to kill the whole ssh session.
    >
    > So the problem can be reduced to get a tty or pty attached to the 
    startup
    > process so that 'intr' can be set correctly before it starts the sshd
    > daemon process.
    I think the problem is in your expectations. You are expecting the sshd,
    that is, the daemon, to establish stty options for all the shell/tty
    sessions that it launches. But that one sshd may need to launch multiple
    sessions, for multiple users, who have different requirements. Maybe one
    user wants to use ctrl-C as an interrupt key, and another wants to use
    DELete, for instance.
    It may be true that when sshd is launched from a tty session, it inherits
    the tty settings of that process. If the sshd is launched at startup, the
    stty settings should probably be considered "uninitialized variables".
    The proper way for stty settings to be established is by the client. Part
    of the SSH protocol is for the client to tell the daemon what the stty
    settings should be. That way each client/user can have its own settings.
    If you start a Unix/Linux based SSH client from a shell session, it should
    inherit the stty settings of that shell session, and pass them to the
    daemon. If you are running a Windows-based SSH client, it should establish
    a reasonable set of conditions (Anzio, our client, does this).
    What client are you running?
    Finally, if the settings sent by the client are not appropriate, they can
    be overridden by an stty command in the shell startup script for the user
    (.profile, .bashrc), or even at a system-wide level (/etc/profile).
    Hope that helps.
    Regards,
    ....Bob Rasmussen,   President,   Rasmussen Software, Inc.
    personal e-mail: ras@anzio.com
     company e-mail: rsi@anzio.com
              voice: (US) 503-624-0360 (9:00-6:00 Pacific Time)
                fax: (US) 503-624-0760
                web: http://www.anzio.com
    

  • Next message: Patrick Colony: "Re: openssh-3.7.1p2 & openssh-3.8p1"

    Relevant Pages

    • Re: HP-UX: ssh connections ignore CTRL+C interrupts
      ... > When I start sshd from an interactive shell, ... stty settings should probably be considered "uninitialized variables". ... The proper way for stty settings to be established is by the client. ... If you start a Unix/Linux based SSH client from a shell session, ...
      (SSH)
    • Re: SunSSH in Solaris 9 problems connecting to a Linksys router problem
      ... This means either the client didn't understand what ... This tells me that there may be something you can do with stty to make ... your sshd is expecting to see that's not being set or there might be ... If not, then you might look at the man pages for termio, termiox, and ...
      (comp.unix.solaris)
    • Re: ctrl-l in bash
      ... > How do I echo ctrl-l in bash? ... if you haven't changed your default settings ... using stty.) ...
      (comp.os.linux.misc)
    • Re: Stty question
      ... POSIX compliance might be. ... stty -a returns in part: ... POSIX stty does not define options to alter these settings. ... So, are we talking hardware terminals, software terminals, or xterms? ...
      (comp.os.linux.misc)
    • Re: Stty question
      ... POSIX compliance might be. ... stty -a returns in part: ... POSIX stty does not define options to alter these settings. ... So, are we talking hardware terminals, software terminals, or xterms? ...
      (comp.os.linux.misc)