Skip to content

Adding a logo to the ssh login

Hecatron edited this page Sep 26, 2020 · 3 revisions

Generate Coloured ASCII text

One of the tricks we can do is display a graphic when logging onto the server via ssh.
The first step is to take an image / picture and convert it into coloured ascii

Save to Profile

Next we can't put this into /etc/motd since it won't render the colours or graphics.
You can leave the contents of /etc/motd as is or remove them, these will be printed first before the logo.

Instead we need to create a script that will run when a user logs on to show the graphic.
login_logo.sh

#!/bin/bash
echo -e "
\033[0;31m
 ____        _  __   _  _        _
|  _ \ _ __ (_)/ /_ | || |      / \   _ __  _ __  ___  ___ _ ____   __
| |_) | '_ \| | '_ \| || |_    / _ \ | '_ \| '_ \/ __|/ _ \ '__\ \ / /
|  _ <| |_) | | (_) |__   _|  / ___ \| |_) | |_) \__ \  __/ |   \ V /
|_| \_\ .__/|_|\___/   |_|   /_/   \_\ .__/| .__/|___/\___|_|    \_/
      |_|                            |_|   |_|

\033[0m
"

Save this into /etc/profile.d/ for it to be run on login

for other example of stuff you can put into the script