You've seen the warning messages when a hacker tries to enter a server and it says something like "Warning! Do not enter!" etc. Here's how you can make your own using one before a user logs in and one after a user logs in. The screenshots you see below are using MobaXterm SSH client but will work for any SSH client.
Before login, you are greeted with adding a username and password. The following will add a message BEFORE you are allowed to enter a password. First, you'll need to enable banners by editing the following file:
/etc/ssh/sshd_config - NOT /ssh_config! There are 2 similar files!
Edit the following line:
So it looks like this:
To make message appear AFTER the use has logged in edit the following file to make that happen:
Just delete whatever is there and add the message of your choice like "Warning! If you are not authorized to be here YOU MUST DISCONNECT NOW!!!" as shown in the line the top arrow is pointing to. In this example, I have mine set to store the password so it automatically logs me in and is why you don't see it asking for a password.
To make a message show after the user has used their password and has logged in edit this file and add your own message like the one shown in the image below with the bottom arrow:
When you are finished doing one or both of those then restart the SSH daemon (sshd):