MOTD ubuntu - where does it come from

Hi

ssh login brings me to a nextcloud message like this one:

Last login: Wed Jan 30 09:35:54 2019 from


| | |_____ | | | |_ _ _ | |
| ./ -_) \ / _/ _| / _ \ || / _ |
|_|__
/_\___|___/_,_,|

 https://www.nextcloud.com

I’m using ubuntu 16.04, have checked the content of /etc/update-motd.d and could not find the nextcloud message. I was expecting it to be a message of the day displayed after console login.
Could you point me to the right place.
I’m actually looking for more information than what is left when nextcloud message is displayed.

It is not displayed when I ssh as root.

Thanks.

This really only relates to Linux and SSH, not to Nextcloud. So you’re better off looking for help from those communities. I’d say to search for things like “motd”, “linux” and/or “ssh”.

That said, I looked into this for a bit and it seems that the MOTD at SSH login should be composed of the output of the script(s) in /etc/update-motd.d, followed by the text in /etc/motd. At least, for me, on a Debian system. SSH also seems to have an option to provide a Banner (in /etc/ssh/sshd_config) that seems like it would override this message (I did not test this myself).

Did some searching because that NEXTCLOUD motd/banner was driving me crazy! Could’nt find the culprit.

Then, I found this post and that comment from @Marcm saying it only occurs with a specific user, I decided to dig into the user config files in my default user’s home.

I found out that .bash_profile had a line executing a nextcloud script:

/var/scripts/nextcloud.sh

After reading the script, I realized it was generating that darned motd I never asked for!

What I did is I disabled that line in the bash_profile by adding a # in front of it

sudo nano ~/bash_profile

then I went down to the line to add a # (to disabled it):

#bash /var/scripts/nextcloud.sh

Ctrl X (exit) ; Y (yes) , Enter to save and exit.

Then I reloaded that bash_profile:

source .bash_profile

Exited my SSH session and started a new one.

The Nexcloud logo is gone and SSH is now showing the generated contents of the /etc/update-motd.d/ scripts.


Alternatively, If you want to keep parts of the script (example, you want to keep seeing your IPs, you could instead edit the nextcloud script to remove the NEXTCLOUD logo by disabling the line generating it.

sudo nano /var/scripts/nextcloud.sh

Then, add a # in front of the line starting with “figlet” (and any other line you don’t want to see):

#figlet -f small Nexcloud

Ctrl X; Y , Enter.