How to change Ubuntu Server Login message

6,198

The Banner directive of /etc/ssh/sshd_config takes a filename as argument and shows the file content before user login, precisely before password prompt.

Edit /etc/ssh/sshd_config and append:

sudo bash -c 'echo "Banner /path/to/file.txt" >>/etc/ssh/sshd_config'

change the filename to meet your need. Or use your preferred editor to edit the file.

Don't forget to restart the ssh daemon:

sudo service ssh restart

On systemd:

sudo systemctl restart ssh
Share:
6,198

Related videos on Youtube

Nokey
Author by

Nokey

Updated on September 18, 2022

Comments

  • Nokey
    Nokey over 1 year

    I would like to change the first login message when I SSH to the server. Currently I use putty to SSH to my Ubuntu Server 16.04 and the first login page displays Login as: This is where I input my username.

    I would like to add a message for my other users here with specific information about this server.

    I know how to modify and the motd. The motd displays after login. i want to change what is displayed at the SSH login page.

    • Nokey
      Nokey almost 8 years
      That post is about post SSH login. I want to change what is displayed at the SSH login page.
  • Nokey
    Nokey almost 8 years
    Sorry, I missed the part about the Banner on the other thread. You are correct and answered my question.