Setting a Custom SSH Warning Banner
Create the Banner File
Create a file to store your warning banner text. This file typically resides in
/etc/issue.net
.
nano /etc/issue.net
Add your warning message.
WARNING: Unauthorized access to this system is prohibited.
All activities are monitored and logged.
Save and exit the editor.
Configure SSH Warning Banner
Edit the OpenSSH server configuration file:
nano /etc/ssh/sshd_config
Locate the
Banner
directive and set it to the path of your banner file:
Banner /etc/issue.net
Save and exit the editor.
Apply the changes by restarting the SSH service:
systemctl restart sshd
Test the Banner
Connect to the server using SSH and check if the banner appears:
ssh username@your-server-ip
The banner should display before the login prompt.
Last updated
Was this helpful?