Skip to content

Instantly share code, notes, and snippets.

@nepsilon
Last active December 22, 2018 17:50
Show Gist options
  • Save nepsilon/9d992197cf277ba84c9f to your computer and use it in GitHub Desktop.
Save nepsilon/9d992197cf277ba84c9f to your computer and use it in GitHub Desktop.
Display a cool banner when you log in with SSH — First published in fullweb.io issue #39

Display a cool banner when you log in with SSH

SSH gives us a way to displaya custom welcome message when a user log in. You can make this message dynamic thanks to update-motd, but here we’ll talk about the SSH built-in feature.

Here is how to do in 3 steps:

Put your message in /etc/issue.net:

$ vim /etc/issue.net
# (Check out cowsay to have a cow tell your msg)

Turn on this SSH feature:

vim /etc/ssh/sshd_config 

Then in /etc/ssh/sshd_config uncomment this line below and save+exit:

#Banner /etc/issue.net
# Just remove the first # character to uncomment

Restart SSH:

sudo etc/init.d/sshd restart

Now whenever you log in, the message will appear :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment