Whole document tree 9.4. Restrict console messagesGenerating a stready stream of console messages can easily overwhelm a 9600bps link. Although displaying all syslog messages on the console appears to be a good idea, this actually provides a nice method to deny effective use of the remote console. Configure log messages to the console to the bare minimum, especially if the machine accepts remotely generated syslog messages. Look in /etc/syslog.conf for lines ending with /dev/console. Users that are logged into the serial console should not accept broadcast messages. Add new files to /etc/profile.d to do this. Figure 9-1 shows a file for use by the Bourne shell. Figure 9-1. Restrict sending of messages to console user
As this file is run frequently, we use a faster but less readable version of the above, shown in Figure 9-2. Figure 9-2. Restrict sending of messages to console user, /etc/profile.d/mesg.sh
We also need a C shell version, shown in Figure 9-3. Figure 9-3. Restrict sending of messages to console user, /etc/profile.d/mesg.csh
Although mesg.sh and mesg.csh are included by the parent shell rather than executed, the files need the execute permission set. The procedure in Figure 9-4 installs the files and sets the permissions. |