EC2Linux

Setup Banner Login Message on Amazon Linux/CentOS/RHEL

In this article, we explain how to Setup Banner Login Message on Amazon Linux/CentOS/RHEL when a user login to server via SSH. We can set Banner for displaying welcome or informational messages to the user at ssh logins, It is also called as SSH Login Banner Message.

Best Practises for Linux System Admin to configure banner, here you can display warnings/info message whenever user do ssh login on the server.

See my example banner message which I used for my all servers.

This computer system is for authorized use only. All activity is logged and regularly checked by NOC Team. Individuals attempting to connect to, port-scan, deface, hack, or otherwise interfere with any services on this system will be reported.

We can display the message in two way:

  1. issue.net: Display a message before the password login prompt.
  2. motd: Display message after the user has logged in. example when a user login with ssh-keys instead of a password.

Just follow simple steps to enable SSH logging messages.Setup Banner Login Message on Amazon Linux/CentOS/RHEL

SAMPLE MESSAGE for banner

This computer system is for authorized use only. All activity is logged and regularly checked by NOC Team. Individuals attempting to connect to, port-scan, deface, hack, or otherwise interfere with any services on this system will be reported.

If you are using ssh-keys to login server then you can’t display a message before user login. In this case, follow this method:

Paste above sample message.

Permanently change the MOTD banner on AWS EC2 Amazon Linux:

Solution-1: Changing the /etc/motd on  Amazon EC2 Instance is temporary because once instance rebooted then banner also get updated.

It is actually updated by a script at /usr/sbin/update-motd and the banner you see can be found at /etc/update-motd.d/*-banner. You can turn off the update script with below command:

Solution 2: Open ssh configuration file and enable banners.

Search for “Banner” and update it as mention below and save the file (you can use any path).

Save the file and restart sshd service to reflect new changes.

This is how you can setup banner login message on Amazon Linux/CentOS/RHEL

Related Articles

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close

Adblock Detected

Please consider supporting us by disabling your ad blocker