openssh-portable
openssh-portable copied to clipboard
Use /etc/login.defs for TTYGROUPS and TTYPERM
There exists the file /etc/login.defs from shadow-utils on some systems, including Linux. This file defines many aspects, most of which are irrelevant and replaced by PAM. Two properties defined in them are not to be found anywhere else, however: TTYGROUPS and TTYPERM.
I miss these in SSH, as I would like to have mesg n per default, i.e. I don't want users to be able to write into each others terminals unless explicitly allowed by the receiver. Currently, SSH just uses the group "tty" and the constant mode 0620 if this group exists, 0600 otherwise.
The parser is adapted from read_etc_default_login in session.c.