Creating Logon Messages to Communicate with Users in Linux

30 minutes
  • 4 Learning Objectives

About this Hands-on Lab

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
  1. 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."
  2. Update the Banner path in /etc/ssh/sshd_confi to point to /etc/issue.net, and restart the sshd service.
  3. Test the change by attempting an additional login to the host.
Use /etc/motd to Present a Message to Users Who Have Successfully Logged In Based on the Instructions Provided
  1. 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"
  2. 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
  1. Send a wall message using the text file maintenance.txt in /home/cloud_user (suppress the banner message).
  2. Using the shutdown command, schedule a power-off of the system to take in 4 hours of the current time.
  3. Cancel the shutdown (optional).

Additional Resources

You work as a system administrator for a mid-level supply company and you have been tasked with setting up logon messages to automate communication about system information and maintenance. In order to complete this task you will need to update /etc/issue to notify users logging in locally of the operating system name, the date and time, and the number of logged-in users using escape characters.

Next, you will need to update /etc/issue to include a warning message for users logging in remotely. Be sure to add this to the Banner path in /etc/ssh/sshd_config and restart the sshd service so that the change takes affect.

Once /etc/issue and /etc/issue.net have been updated, you will need to update /etc/motd to present a welcome message to users, letting them know that maintenance occurs on the last Friday of every month at 8:00 PM, local software should be installed to the /opt directory, and permission request can be sent to admin@acloud.guru.

Lastly, use the wall command to send a message using /home/cloud_user/maintenance.txt to alert users of the upcoming maintenance. Then, power off the machine four hours from the current time.

Note:

  • All tasks should be performed as the root user.
  • The /home/cloud_user/maintenance.txt file has been provided.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Get Started
Who’s going to be learning?

How many seats do you need?

  • $499 USD per seat per year
  • Billed Annually
  • Renews in 12 months

Ready to accelerate learning?

For over 25 licenses, a member of our sales team will walk you through a custom tailored solution for your business.


$2,495.00

Checkout
Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!