Logon messages is a great way to automate communications on a Linux system. These can be used to inform users of upcoming system maintenance and other pertinent system information. In this lab, you will be tasked with creating logon messages for local and remote logins, as well as successful logins. In addition to automated messages, you will need to communicate with active users using the wall command and schedule a shutdown of the host to be performed at a later time.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Use /etc/issue to Present a Message to Users Logging In Locally Based on the Instructions Provided
Update
/etc/issue
to include the name of the operating system, date, and time, and the number of current users using escape characters.- Use /etc/issue.net to Present a Message to Users Logging In Remotely Based on the Instructions Provided
- Use a text editor to add the following text to
/etc/issue.net
: "Warning! This system is for authorized users only. To obtain access, email admin@acloud.guru." - Update the Banner path in
/etc/ssh/sshd_confi
to point to/etc/issue.net
, and restart the sshd service. - Test the change by attempting an additional login to the host.
- Use a text editor to add the following text to
- Use /etc/motd to Present a Message to Users Who Have Successfully Logged In Based on the Instructions Provided
Add the following message to
/etc/motd
:"Welcome to server01!
- Maintenance will occur at 8:00 pm on the last friday of the month.
- Local software should be installed in /opt
- For elevated permissions email admin@acloud.guru"
- Validate the change by logging into the host.
- Notify Users of Upcoming System Maintenance and Issue a Power-off on the Host to be Performed in 4 Hours from the Current Time
- Send a wall message using the text file
maintenance.txt
in/home/cloud_user
(suppress the banner message). - Using the
shutdown
command, schedule a power-off of the system to take in 4 hours of the current time. - Cancel the shutdown (optional).
- Send a wall message using the text file