Why "ssh -f -n" still connects to ptys?

Clark Wang dearvoid at gmail.com
Tue Feb 7 17:15:03 AEDT 2017


See following example:

$ ps p 45374
   PID TTY      STAT   TIME COMMAND
 45374 ?        Ss     0:00 ssh -N -D 7777 -f -n localhost
$ ls -l /proc/45374/fd/
total 0
lrwx------ 1 root root 64 2017-02-07 14:12 0 -> /dev/pts/2
lrwx------ 1 root root 64 2017-02-07 14:12 1 -> /dev/pts/2
lrwx------ 1 root root 64 2017-02-07 14:12 2 -> /dev/pts/2
lrwx------ 1 root root 64 2017-02-07 14:12 3 -> socket:[348711]
lrwx------ 1 root root 64 2017-02-07 14:12 4 -> socket:[348767]
$

Why not open FDs 0, 1 and 2 on /dev/null?

-clark


More information about the openssh-unix-dev mailing list