• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

How to set motd in linux

April 5, 2014 by Sharad Chhetri Leave a Comment

In this tutorial we will learn,how to set Message Of The Day ( motd ) on Linux systems. The motd abbreviation is “Message Of The Day”. The motd is widely used in Linux servers.

Uses of MOTD ( Message Of The Day )

As the name defines, the motd is used for displaying message when user login into the system.
You can display any kind of message on screen. Either it can be legal notice, information, planned outage, warning, alert or anything as per your requirement.

Absolute path of MOTD file

The absolute path of motd file is /etc/motd in Linux Operating System.

Set motd ( message of the day )

Setting motd in linux is very easy.You only have to edit the file /etc/motd and save it.
(There is no service associated with motd)

For eg. I am setting the motd with information, “Unauthorized access to this server is strictly prohibited !!”
Similarly,you can write any other message in /etc/motd file .

vi /etc/motd

Unauthorized access to this server is strictly prohibited !!

Save the file /etc/motd .

Displaying motd to users accessing server by ssh

To display motd to users accessing by ssh method. We have to uncomment the PrintMotd parameter and make its value as yes in /etc/ssh/sshd_config file.

vi /etc/ssh/sshd_config

PrintMotd yes

Now restart or reload the ssh service

# In Debian/Ubuntu
/etc/init.d/ssh restart

# In RHEL/CentOS/Scientific Linux
/etc/init.d/sshd restart

How to verify is motd working ?

To verify the motd status, just log-out and relogin to system again .
Also, access the system via ssh for verifying, in case users login with ssh method.

Example 1: Accessing directly to server. The system is running in runlevel 3

motd

Example 2: Accessing server via ssh

motd ( message of the day )

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. Linux: Set user password by using encrypted password in command
  2. Yum command to download rpm file without installing in linux system
  3. How to extract RPM package on Linux system
  4. How to show line numbers with less command in Linux
  5. How to show user account password expiration detail on Linux
  6. 6 important examples of cd command on Linux and Unix Systems
  7. print working directory ( pwd , PWD , OLDPWD ) in Linux / Unix
  8. Head command in Linux / Unix
  9. Linux : clear command and its keyboard shortcut
  10. Linux Basic Commands With Examples For Every Beginner

Filed Under: Linux, Linux Commands Tagged With: linux command, motd

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

Allow only members of Wheel group to use su command on RHEL/CentOS

How to encode and decode the strings with base64

postgres database backup script using database user password inside

How to page scroll up/down in Linux terminal

30 useful Linux terminal keyboard shortcuts

The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form

linux release renew dhcp assigned ip address

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy