Ubuntu Linux: OpenSSH Change Welcome Login Message

To change the welcome login message in OpenSSH on Ubuntu Linux, you can follow these steps:

  1. Log in to your Ubuntu system as the root user or a user with sudo privileges.
  2. Open the sshd_config file using a text editor of your choice. This file is typically located in the /etc/ssh/ directory. For example, to open the file using the nano editor, you can run the following command:
sudo nano /etc/ssh/sshd_config
  1. Look for the Banner directive in the sshd_config file. If the directive is commented out (i.e., starts with a # character), uncomment it by removing the # character. If the directive is not present, add it to the file.
  2. Set the Banner directive to the full path of the file that contains your new welcome message. For example, if your welcome message is stored in the file /etc/ssh/welcome.txt, you would set the Banner directive like this:
Banner /etc/ssh/welcome.txt
  1. Save the changes to the sshd_config file and exit the text editor.
  2. Restart the OpenSSH server to apply the changes. You can do this by running the following command:
sudo systemctl restart sshd
  1. Test the new welcome message by logging in to the system using SSH. You should see the new message displayed before the login prompt.

Note that the welcome message file should be readable by all users, not just the root user. Also, be sure to choose a message that is appropriate for your environment and complies with your organization’s security policies.

Leave a Comment