[Bug 2743] ssh with -T hangs putty

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Wed Jul 12 09:43:49 AEST 2017


https://bugzilla.mindrot.org/show_bug.cgi?id=2743

Darren Tucker <dtucker at zip.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dtucker at zip.com.au

--- Comment #1 from Darren Tucker <dtucker at zip.com.au> ---
I can reproduce this but I think PuTTY is at fault.  Or at least
there's a mismatch between what you expect and what PuTTY does.

I built sshd with -DPACKET_DEBUG I can see the keystroke arrive at the
server:

debug1: input: packet len 32
debug1: partial packet: block 16, need 16, maclen 20, authlen 0, aadlen
0
read_poll enc/full: buffer 0x80ff8ec0 len = 36
0000: 9d 58 ac 75 69 f6 e3 01 c9 4a 10 f7 97 44 3c 69  .X.ui....J...D<i
0016: 95 f0 18 77 7e 83 39 58 df ec b1 5c 33 ea 53 24  ...w~.9X...\3.S$
0032: 71 e1 02 b7                                      q...
debug1: MAC #9 ok
debug1: input: padlen 17
debug1: input: len before de-compress 10
read/plain[94]:
buffer 0x80ff6848 len = 9
0000: 00 00 00 00 00 00 00 01 54                       ........T

So the packet arrives but what happens to it?  I added "echo $$" to the
shell startup and I see that, so the shell starts.   I straced the
shell after startup and I see:

read(0, "i", 1)                         = 1
read(0, "d", 1)                         = 1
read(0, "\r", 1)                        = 1
read(0, 

and compared this to ssh -T which doesn't hang when I do the same
thing:

read(0, "i", 1)                         = 1
read(0, "d", 1)                         = 1
read(0, "\n", 1)                        = 1
[shell proceeds to run and return output from "id"]

So, PuTTY isn't requesting a pty because you asked it not to, then it's
sending your keystrokes to the server which is getting them.  You're
not seeing anything because you don't have a pty and there's no
per-keystroke echo.  You don't see any output when you hit enter
because PuTTY sends a \r instead of the \n the shell is expecting, so
as far as the shell is concerned you're still entering a command.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.


More information about the openssh-bugs mailing list