Monday, June 17, 2013

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



Here 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 #
###############################################################



Open /etc/ssh/sshd_config file:
sudo nano /etc/ssh/sshd_config



Locate the line, that contains Banner and uncomment it as given below:
Banner /etc/issue.net



Restart sshd:
sudo service sshd restart



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



Here 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 #
######################################



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



Hope this will help you!

No comments:

Post a Comment