7.5 Set 'mesg n' as Default for All Users - /etc/profile mesg = n

Information

The "mesg n" command blocks attempts to use the write or talk commands to contact users at their terminals, but has the side effect of slightly strengthening permissions on the user's tty device.

Since write and talk are no longer widely used at most sites, the incremental security increase is worth the loss of functionality.

Solution

Perform the following to implement the recommended state:
# cd /etc
# for file in profile .login ; do if [ "`grep mesg $file`" ]; then awk '$1 == "mesg" { $2 = "n" } { print }' $file > $file.CIS; mv $file.CIS $file; else echo mesg n >> $file; fi; done

See Also

https://workbench.cisecurity.org/files/612

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-6b., CSCv6|3.1

Plugin: Unix

Control ID: decf07cfba0f90612ad2b2024344a49121d1b1d45318f5f1bea9db981a76a766