How To Add a Warning Message To SSH

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:

 

#Banner None

 

So it looks like this:

 

Banner /etc/issue.net

 

To make message appear AFTER the use has logged in edit the following file to make that happen:

 

/etc/issue.net

 

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:

 

/etc/motd

 

 

When you are finished doing one or both of those then restart the SSH daemon (sshd):

 

https://client.buildzhosting.com/index.php/knowledgebase/43/Restarting-The-SSH-Service.html

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

What if I need extra space for my VPS?

You may purchase extra space for $1 per GB per month or $3.50 for 5GB per month. You may...

What if I need extra IP's for my VPS?

You may purchase extra IP Addresses for $4 per IP Address per month. You may purchase these at...

Do you offer Managed VPS Hosting?

No, not at this time. However, we will be glad to answer any questions you many have or try to...

What kind of control panel do you have for VPS Hosting?

You may use whatever hosting control panel you wish to install. You will have to install it...

VPS Hosting is like living in an apartment complex.

VPS Hosting is like living in an apartment complex. You have a few other people living in the...