In this short tutorial I will show you how to display a ssh welcome banner that will show once a user successfully logs into your server/computer. I will also show you how to create a message once the connection is first established and before the user enters their password.
Why would I want to do this?
Simple, lawyers may argue that an actual offense or abuse to your system can only be known by the user if they were warned.
Create the login banner message
Let’s first start by displaying a message when the ssh user first logs in.
Edit the /etc/motd template using your favorite editor. I prefer vim.
Next, add a message to the user like I did here.
Create the initial ssh connection banner message
Finally, let’s show a user who first connects to the system but before they try to enter a password. In order to do this we need to first edit the /etc/ssh/sshd_config file and add this to the bottom of that file.
Next, let’s create the file and then place a message inside of it and then save it like so.
Finally, you should restart your sshd services.
That is all you have to do. If this post helped you successfully create a ssh banner message, please leave a reply below.