Ubuntu Linux: OpenSSH Change Welcome Login Message

How do I change Openssh welcome login message under Ubuntu Linux?

First create a text file called /etc/ssh/welcome.msg using a text editor such as vi:
$ sudo vi /etc/ssh/welcome.msg
Append your welcome message:

Welcome to nixCraft Labs.

Save and close the file.
Next, edit /etc/sshd/sshd_config, enter:
$ sudo vi /etc/sshd/sshd_config
Add / edit as follows:
Banner /etc/ssh/welcome.msg
Save and close the file. Reload, ssh server:
$ sudo service ssh reload
Test your new settings:
$ ssh localhost
$ ssh user@server1.nixcraft.com

Sample outputs:

Welcome to nixCraft Labs!

vivek@localhost's password: 

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 9 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
9 comments… add one
  • thefixer Dec 14, 2010 @ 16:41

    nope, doesnt work on Ubuntu 9

    • thefixer May 5, 2011 @ 14:36

      Actually, I must be an idiot, coz I just found this article again did the same thing and it works fine, only caveat in Ubuntu 9 is that

      its not /etc/sshd/sshd_config

      it is actually /etc/ssh/ssd_config

      • thefixer May 5, 2011 @ 14:37

        derp I meant


  • Charlie Mar 15, 2011 @ 3:24

    You will need to restart sshd….
    /etc/init.d/ssh restart

    • Charlie May 6, 2011 @ 22:33

      I did and it didn’t help my situation.
      I use /etc/issue.net as my banner.
      The Welcome message works.
      My problem is that PAMD also does it’s thing.
      Like.. reports on the system’s status, if there are updates pending, and if a reboot is recommended to reload the updated Kernel.
      Then there is the last login line.
      So far I have three sources from which come the log-on display.

      • thefixer May 6, 2011 @ 23:20

        So your saying that PAMD is dumping the system status on the PreLogin message instead of after the login??

  • Connor Dec 14, 2011 @ 18:32

    Thanks for this, works a charm for me. You might want to update the file location to /etc/ssh/sshd_config as its in the comments but not in the post.

    Helped a lot though :)

  • Arul Dhanapani Apr 11, 2012 @ 4:47

    It’s Work.. Thanks

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum