Operating System - HP-UX
1834114 Members
2407 Online
110063 Solutions
New Discussion

Re: ctrl-c not working with SSH A.03.10.001

 
Thomas F. Blich
Advisor

ctrl-c not working with SSH A.03.10.001

On a 11.0 box

# swlist | grep T1
T1471AA A.03.10.001 HP-UX Secure Shell

If I telnet to this server, CTRL-C works. If I ssh to this box CTRL-C is ignored.

17 REPLIES 17
Jeff Schussele
Honored Contributor

Re: ctrl-c not working with SSH A.03.10.001

Hi Thomas,

Once you get the shell on the system via ssh - do a
#stty -a
And see what value intr= is set to.
If strange try
#stty intr ^C
That's shift-6 & Cap C.
Then try the ctrl-C again.
If all OK now, you'll have to determine just what's changing intr. If unable to determine, you'll have to modify the .profile (or whatever's appropriate) to set the intr value for you @ login.

HTH,
Jeff

PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Thomas F. Blich
Advisor

Re: ctrl-c not working with SSH A.03.10.001

Logged in via SSH

# stty
speed 300 baud; -parity hupcl
intr = ^C; erase = ^H; kill = ^X;
swtch ;
susp = ^Z;
werase = ^W; lnext = ^V;
brkint -inpck icrnl onlcr tab3
-iexten echo echoe echok
-echoctl -echoke
ROOT[aries:/root]
#

Logged in via Telnet

# stty
speed 9600 baud; evenp hupcl -cread
intr = ^C; erase = ^H; kill = ^X;
swtch ;
brkint -inpck icrnl -ixany onlcr tab3
-iexten echo echoe -echok
-echoctl -echoke
ROOT[aries:/root]
#
Jeff Schussele
Honored Contributor

Re: ctrl-c not working with SSH A.03.10.001

Hi (again) Thomas,

Well, after seeng that output, my guess would be that the problem is the mismatch in the sessions between -parity & evenp. They (parity/evenp) are essentially the same setting
parity/evenp => parenb & cs7
-parity/-evenp => -parenb & cs8
So telnet session is 8-bits enabled parity
While the ssh session is 7-bit parity disabled.

Try on ssh session
#stty evenp
And see if that clears it up. Then determine where the -parity is being set & change it to evenp.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Thomas F. Blich
Advisor

Re: ctrl-c not working with SSH A.03.10.001

Setting the parity with stty evenp does not resolve the issue.

stty evenp

# stty
speed 300 baud; evenp hupcl
intr = ^C; erase = ^H; kill = ^X;
swtch ;
susp = ^Z;
werase = ^W; lnext = ^V;
brkint -inpck icrnl onlcr tab3
-iexten echo echoe echok
-echoctl -echoke
Jeff Schussele
Honored Contributor

Re: ctrl-c not working with SSH A.03.10.001

Do the erase (^H) & kill (^Z) controls function?

Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Thomas F. Blich
Advisor

Re: ctrl-c not working with SSH A.03.10.001

ctrl-Z does not do anything, but I am not sure what it should do.

ctrl-H functions as a backspace.

Jeff Schussele
Honored Contributor

Re: ctrl-c not working with SSH A.03.10.001

kill is essentially the "delete line" char & will throw away the current line.

Have you tried
#stty sane
to see if you get the ctrl-C back?

Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Thomas F. Blich
Advisor

Re: ctrl-c not working with SSH A.03.10.001

stty sane does the following

# stty
speed 300 baud; evenp hupcl
swtch = ^@;
susp = ^Z;
werase = ^W; lnext = ^V;
brkint -inpck icrnl onlcr
-iexten echo -echoe echok
-echoctl -echoke
ROOT[aries:/root]
#
ROOT[aries:/root]
#
ROOT[aries:/root]
# ^C
ksh: ^C: not found
ROOT[aries:/root]
#
Jeff Schussele
Honored Contributor

Re: ctrl-c not working with SSH A.03.10.001

Well you don't have an intr at all now - so try
#stty intr '^C'
Single quotes required - think I missed that on my initial reply.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Thomas F. Blich
Advisor

Re: ctrl-c not working with SSH A.03.10.001

I was able to set the CTRL-C interrupt, but it still does not do anything.

ROOT[aries:/root]
# stty intr ^C
ROOT[aries:/root]
# stty
speed 300 baud; -parity hupcl
intr = ^C;
swtch = ^@;
susp = ^Z;
werase = ^W; lnext = ^V;
brkint -inpck icrnl onlcr
-iexten echo -echoe echok
-echoctl -echoke
ROOT[aries:/root]


It could not be set using single quotes.
Jeff Schussele
Honored Contributor

Re: ctrl-c not working with SSH A.03.10.001

Well, I'm running out of ideas.
Something has to be intercepting the ctrl-C

Maybe somebody will see what we're missing here.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Daimian Woznick
Trusted Contributor

Re: ctrl-c not working with SSH A.03.10.001

What client are you using to connect via SSH? Have you tried another client program?

I have used both Putty and FSecure with no problems with CTRL-C.
Thomas F. Blich
Advisor

Re: ctrl-c not working with SSH A.03.10.001

I am using SecureCRT 3.4. This used to work with version 2.5.1p1. This behavior started as soon as I installed the 3.1.p1.

If I telnet to the box and then ssh to it, the CTRL-C stops working as well. I don't think it is a client problem. I think it is a server problem.


Jeff Schussele
Honored Contributor

Re: ctrl-c not working with SSH A.03.10.001

Couple of other things:

1)Do #stty -a (NEED the -a) & check the value isig/-isig. If it's -isig then that's what's telling the system to ignore intr. If so do stty isig
to turn it back on.

2) Make sure that no profile is setting
trap "" 2
Which would cause the trap of the intr signal.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Thomas F. Blich
Advisor

Re: ctrl-c not working with SSH A.03.10.001

# stty -a
speed 300 baud; line = 0;
rows = 30; columns = 83
min = 1; time = 1;
intr = ^C; quit = ^\; erase = ^H; kill = ^X
eof = ^D; eol = ^@; eol2 ; swtch
stop = ^S; start = ^Q; susp = ^Z; dsusp
werase = ^W; lnext = ^V
-parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk -crts
-ignbrk brkint -ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
ixon ixany -ixoff -imaxbel -rtsxoff -ctsxon -ienqak
isig icanon -iexten -xcase echo echoe echok -echonl -noflsh
-echoctl -echoprt -echoke -flusho -pendin
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop tab3
ROOT[aries:/opt/ssh/etc]
#
ROOT[aries:/opt/ssh/etc]
# trap
0:echo logout
ROOT[aries:/opt/ssh/etc]
#
ROOT[aries:/opt/ssh/etc]
#

dirk dierickx
Honored Contributor

Re: ctrl-c not working with SSH A.03.10.001

Don't know if you are using the HP provided ssh or the depot file from the HPUX porting center.

I had this same problem with one certain version from the porting center. i upgraded when a newer version became available and the 'ctrl-c' problem was gone.
Thomas F. Blich
Advisor

Re: ctrl-c not working with SSH A.03.10.001

Thank you for all your help.

I don't know how this happened, but when I first installed the sshd, the CTRL-C was not enabled. I tried to stop sshd, and I had to kill -9 it. This made me think that the SSHD process was trapping ctrl-c and ignoring it.

I used telnet to get to the box, killed the sshd daemon and restarted it. I then was able to get sshd to recognize the interrupt signal.