SSH (Secure Shell) is a protocol used for remote access to Linux systems. One way to enhance security and provide information to users is by setting a custom SSH warning banner and Message of the Day (MOTD). In this guide, we'll show you how to do this on a Linux system.
banner and located in the /etc/ssh/ directory.sudo vim /etc/ssh/banner
******************************* WARNING ***********************************
Welcome to the [Company Name] Secure Shell. Unauthorized access is strictly
prohibited and will result in immediate disciplinary action. All activity is
monitored and recorded. Unauthorized access will be investigated and punished
to the fullest extent of the law.
By accessing this system, you acknowledge that all data stored and processed
here is confidential and should not be disclosed to unauthorized parties.
If you are not an authorized person, please log out immediately from the system.
****************************************************************************
sudo vim /etc/ssh/sshd_config
# symbol. Add the path to the banner file:Banner /etc/ssh/banner
motd and located in the /etc/ directory:sudo vim /etc/motd
Good morning! Nice to see you again.
sudo systemctl restart ssh
Banner message:

Message of the Day (MOTD):

By following these steps, you can easily set a custom SSH warning banner and MOTD in Linux. This helps improve security and provides important information to users when they log in via SSH. Ensure that users are aware of any security policies or warnings before accessing the system.