OpenSSH and stdin/stdout assigning

Павел Сафронов pv.safronov at gmail.com
Fri Oct 9 09:42:33 AEDT 2015


Hey, guys, I have a question about a difference between openssh 4.3 and 5.3.
I have plenty of servers with RHEL5 and RHEL6.
Most of RHEL5 servers have openssh-server version 4.3p2-72.el5_6.3
(kernel 2.6.39-100.7.1uek)
And RHEL6 servers have 5.3p1-111.el6 (kernel 3.8.13-35.el6uek.x86_64)

So there is the difference in assigning stdin and stdout for ssh
connections. Openssh 4.3 assigns socket (I assume this socket points
to /dev/log but not really sure, I've got it from strace), and openssh
5.3 assigns pipes.

$ ssh root at rhel6 '/bin/ls -la /proc/self/fd'
total 0
dr-x------ 2 root root  0 Oct  9 00:26 .
dr-xr-xr-x 8 root root  0 Oct  9 00:26 ..
lr-x------ 1 root root 64 Oct  9 00:26 0 -> pipe:[3818769145]
l-wx------ 1 root root 64 Oct  9 00:26 1 -> pipe:[3818769146]
l-wx------ 1 root root 64 Oct  9 00:26 2 -> pipe:[3818769147]
lr-x------ 1 root root 64 Oct  9 00:26 3 -> /proc/26794/fd
$ ssh root at rhel6 '/bin/ls -la /proc/self/fd'
total 0
dr-x------ 2 root root  0 Oct  9 00:26 .
dr-xr-xr-x 8 root root  0 Oct  9 00:26 ..
lrwx------ 1 root root 64 Oct  9 00:26 0 -> socket:[3010813704]
lrwx------ 1 root root 64 Oct  9 00:26 1 -> socket:[3010813704]
lrwx------ 1 root root 64 Oct  9 00:26 2 -> socket:[3010813706]
lr-x------ 1 root root 64 Oct  9 00:26 3 -> /proc/12193/fd

I'm wondering is it expected behaviour? Is there way to assign pipes
in openssh 4.3 too?
Looked through code but I'm not very familiar with C programming.

PS Some daemon libs think that if stdin is socket then daemon is
running from inetd and it is causing some troubles.
PSS Sorry for broken english :(


More information about the openssh-unix-dev mailing list