Display a Custom SSH Login Banner or ASCII Art on Linux in Minutes
Learn how to enable OpenSSH's Banner option on a CentOS 7 system, create a custom banner file (including ASCII art generated with figlet), and restart the sshd service so every SSH login shows your personalized message.
OpenSSH provides a built-in Banner option that, when configured, sends the contents of a specified file to the remote user before authentication. By default this option is disabled, so no banner appears during SSH login.
System Environment
CentOS 7
Enabling the Banner
Log into the remote Linux system.
Edit the SSH daemon configuration file /etc/ssh/sshd_config. # vim /etc/ssh/sshd_config Append the following line to the end of the file: Banner /etc/ssh/my_banner Save the file and exit the editor.
Create the banner file that will be displayed: # touch /etc/ssh/my_banner Restart the SSH service to apply the changes:
# systemctl restart sshdAdding ASCII Art to the Banner
You can either copy an ASCII‑art image you like or generate one with the figlet utility. Install figlet (requires the EPEL repository) and create the art:
# yum -y install figlet
# figlet LinuxProbe > /etc/ssh/my_bannerAlternatively, you can paste any ASCII art directly into /etc/ssh/my_banner.
Testing the Banner
Connect via SSH to see the banner in action: # ssh root@localhost The custom message or ASCII art will be displayed before the login prompt.
Conclusion
This simple feature enhances the terminal experience and can also be used with the /etc/motd file for system‑wide messages.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
