How to Update SSH & MOTD Banner on CentOS 6

For legal reasons, Some people need to display a warning banner on their Linux machine before login so that a person requires to acknowledge the contents of the banner before entering the password. To do this, edit a/etc/issue.net file and fill it with the desired context.

Edit the  /etc/issue.net file:

sudo nano /etc/issue.net

001Here is mine banner as a sample, you can add your’s here:

#########################################################
# Authorized access only! # 
# Disconnect IMMEDIATELY if you are not an authorized user!!! #
# All actions Will be monitored and recorded #
###############################################################

002Open /etc/ssh/sshd_config file:

sudo nano /etc/ssh/sshd_config

003Locate the line, that contains Banner and uncomment it as given below:

Banner /etc/issue.net

004Restart sshd:

sudo service sshd restart

005To configure the MOTD, we need to edit /etc/motd file:

sudo nano /etc/motd

006Here is mine custom MOTD that I want to show to the users after login:

################################
 # If you are not authorized to access#
 # or use this system, disconnect now #
 ######################################

007Now, If we try to login, it will show us the warning banner as well as MOTD after login , that we just configured:

008Hope this will help you!

Src: https://rbgeek.wordpress.com/2012/08/08/how-to-update-ssh-motd-banner-in-centos-6/

Share

Leave a Reply

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