206.3. Notify users on system-related issues
206.3 Notify users on system-related issues
Weight: 1
Description: Candidates should be able to notify the users about current issues related to the system.
Key Knowledge Areas:
Automate communication with users through logon messages
Inform active users of system maintenance
Terms and Utilities:
/etc/issue
/etc/issue.net
/etc/motd
wall
/sbin/shutdown
systemctl
This lesson is all about the ways we can notifying other users. An unplanned hardware maintenance might be required, system might need to be rebooted, new kernel has been compiled , ...
There are some active and passive ways in linux, to notify other users. By considering this fact that some users might be logged off the story is made more complicated. Lets start with the simplest command.
wall
wall displays a message, or the contents of a file, or otherwise its standard input, on the terminals of all currently logged in users.(we are using CentOS7):
and from another user terminal point of view, what he/she sees:
How about other users users who access our server via ssh?
shh login banner message
One of the ways to protect and secure SSH logins is by displaying warming message to UN-authorized users or display welcome or informational messages to authorized users.
As a system adminitrator it is a good habit to configure a security banners for ssh logins. The banner contains some security warning information or general information.
There are two way to display messages one is using issue.net file and second one is using MOTD file.
issue.net : Display a banner message before the password login prompt.
motd : Display a banner message after the user has logged in.
Display SSH Warning Message to Users Before Login [/etc/issue.net] :
To display Welcome or Warning message for SSH users before login. We use issue.net file so :
Now inside /etc/ssh/sshd_config
file, We need to edit Banner /some/path
like this:
Our last job is to restart the SSH daemon to reflect new changes (based on your distro sysv, upstart,systemd):
To see the result lets try to ssh to server1 from server2:
Display SSH Warning Message to Users After Login [/etc/motd] :
To display banner messages after user login, we use motd file:
again let get connected to server1 from server2:
and we are done!
shutdown
shutdown schedules a time for the system to be powered down. It may be used to halt, power-off or reboot the machine.
and we can send message while we are using shutdown :
what other users see:
that's all .
Congratulation we have done lpic2-201 !!!
Last updated