How to add a Banner to your Linux machine

Banner is something which you will see before or after you login to a particular system.

In this post I will show you how to create a banner to give a info about the machine which the user is about to access.

Check this file in your machine

# cat /etc/issue   
CentOS release 6.2 (Final)  
Kernel r on an m   

or

# cat /etc/issue.net   
CentOS release 6.2 (Final)  
Kernel r on an m  

This is the file which is read before you login to the machine so we will make some changes here:

# vi /etc/issue  
This node contains Oracle Database 11gR2 and the owner of this node is Deepak.  
This file is read after you log in successfully to your node
# vi /etc/motd   
Welcome Deepak you have successfully logged in.   
# vi /etc/ssh/sshd_config  
 # Add a line 129  
 Banner /etc/issue  

Restart the ssh services

# service sshd restart  
Stopping sshd:                                            [  OK  ]  
Starting sshd:                                            [  OK  ]  

Try to ssh your machine from a client machine

# ssh 10.10.10.19   
 This node contains Oracle Database 11gR2 and the owner of this node is Deepak.   
 root@10.10.10.19's password:   
 Last login: Sun Aug 5 15:13:05 2012 from 10.10.10.30   
 Welcome Deepak you have successfully logged in.