How to create and implement a banner for ssh connections. This is not going to alter MOTD etc., its only the banner or warning screen users see upon connection to the server.

 

1- nano /etc/ssh/banner.local

Remove the current content and replace with your own personal message. This is an example I grabbed from a ChatGPT convo

 


WARNING: Unauthorized access to this system is prohibited! All activities are logged and monitored.




2- Edit sshd_config 

  • nano /etc/ssh/sshd_config
  • remove the # from the Banner line and change the reference to /etc/ssh/banner.local
  • save and close the file
  • restart sshd service

 

To test log out of your current ssh session and login again.