The /etc/motd and /etc/issue files Explained
Linux allows us to display messages before and after login at CLI. It uses two separate files for this. It uses the /etc/issue file to display messages before login. It uses the /etc/motd file to display a message after login.
Displaying banner before login
Linux uses the /etc/issue file to save a login banner or message the shell displays before login. By default, this file contains two options that display Linux and kernel versions. You can edit this file to display a customized message before a user logs in. Let's take an example. Suppose you want to display the following message before the login prompt.
############################# Welcome to the Red Hat training program. Use the following credentials to log in. Username: your enrollment number Password: your first name ##############################
To display the above message on the login screen, open the /etc/issue file.

Add the above message after the default contents and save the file.

To verify the message, exit the current session. Linux displays this file's contents before the user logs in.

The /etc/issue file provides an excellent way to give users specific log in instructions on the login screen.
Displaying banner after login
Linux uses the /etc/motd file to save a login banner or message the shell displays after login. By default, this file is empty. To display a customized message after login, use this file. Let's take an example. Suppose you want to display the following message after the login prompt.
############################# Please submit your enrollment form before Saturday. ##############################
To display the above message when a user logs in, open the /etc/motd file.

Add the above message to the file and save it.

To verify the message, exit the current session and log in again.

Key points
- Linux uses the /etc/issue and the /etc/motd files to display messages before and after the login process.
- The shell displays these messages only on CLI. Users will not see these messages before and after a graphical login.
- The /etc/issue file is typically used to display a login message or banner.
- The /etc/motd file is generally used to display an issue, security policy, or message.
- These messages are global. These messages will be displayed to all users at the CLI prompt.
- Only a privileged user (such as root) can edit these files.
Conclusion
Displaying a customized message before and after login enhances productivity. The /etc/issue file displays a message before the user logs in. The /etc/motd file shows the message after the user logs in. Administrators use these files to customize the shell environment, instruct users about an upcoming policy change or an event, show a personalized greeting message and display many other messages.
By ComputerNetworkingNotes Updated on 2026-06-06