How can I edit the welcome message when ssh start?

Solution 1:

You need to edit two files:

  1. /etc/motd (Message of the Day)
  2. /etc/ssh/sshd_config: Change the setting PrintLastLog to "no", this will disable the "Last login" message.

And then restart your sshd.

Solution 2:

You need to change the contents of /etc/motd. Unfortunately, by default, /etc/motd is a link to /var/run/motd which gets reset every time you login. To make permanent changes, please do the following:

sudo rm /etc/motd
sudo nano /etc/motd

or whatever editor you prefer. Then enter the message you want shown if any, and save the file.

Removing the "last seen" message (e.g., setting PrintLastLog to no in /etc/ssh/sshd_config) is not recommended -- time of last login is valuable security information. It allows for a way to check if someone you did not expect has logged into the system recently. Anyway, it's possible, but do so knowingly.

Solution 3:

On a per-user basis, you can run touch ~/.hushlogin to disable the messages.

Solution 4:

Create a new file and edit the welcome message. Edit /etc/ssh/sshd_config. In that there will be a line called

#Banner /some/path

Edit that path with the newly created welcome message path.


Banner /var/www/welcome.msg

Restart ssh. Now it 'll work.

Solution 5:

Could be modifying the /etc/issue file, try this:

Current date: \d Current time: \t System name: \s Architecture: \m OS build info: \v Hostname: \n Kernel: \r Number of logged-in users: \u.