Make mosh print the message of the day on Ubuntu 14.04

I'm running mosh 1.2.4 on my Ubuntu server, and it's always annoyed me that it doesn't print the message of the day (MOTD) on startup. ssh prints helpful information when you log in, like if you need to reboot or update packages, that I miss when logging in via mosh.

So you can imagine my surprise when I found out that this issue was fixed in version 1.2 of mosh, 4 versions ago!

It turns out Ubuntu does something funky with the message of the day files and I guess mosh got confused. Running the following command fixed it for me:

sudo ln -s /var/run/motd.dynamic /etc/motd

This creates a symbolic link at /etc/motd that will be correctly populated with Ubuntu's crazy message of the day. Now I am politely welcomed every time I log in via mosh :) 

Comments

Note that creating the link causes the message to be printed twice when using ssh.

Add new comment