Quoting RFC4254 § 6.6. Session Data Transfer,
Data transfer for a session is done using SSH_MSG_CHANNEL_DATA and SSH_MSG_CHANNEL_EXTENDED_DATA packets and the window mechanism. The extended data type SSH_EXTENDED_DATA_STDERR has been defined for stderr data.
My question is... why, when I do
ls -latr 1>&2 && pwd, via an interactive shell in PuTTY, am I not seeing any SSH_MSG_CHANNEL_EXTENDED_DATA packets? Here's my PuTTY logs:
It also doesn't work if I set "Connection -> SSH -> Remote command" to
ls -latr 1>&2 && pwd:
It DOES, however, work fine if I set "Connection -> SSH -> Remote command" to
ls -latr 1>&2 && pwd and if I check "SSH -> TTY -> Don't allocate a pseudo-terminal":
Basically, it seems that the use of a TTY precludes the sending of SSH_MSG_CHANNEL_EXTENDED_DATA.