7.5 Set 'mesg n' as Default for All Users

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.

Rationale:

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/benchmarks/4777

Item Details

Category: SECURITY ASSESSMENT AND AUTHORIZATION, SYSTEM AND COMMUNICATIONS PROTECTION

References: 800-53|CA-9, 800-53|SC-7, 800-53|SC-7(5), CSCv7|9.2

Plugin: Unix

Control ID: fd793eef524786597328d91223a7aaa3b804c04bdc5041542509b30d1c40b223