Score:2

ssh welcome message is suddenly gone

ru flag

When I log in into my ubuntu server via ssh the only message that I get is the last login

Last login: Sun Oct 30 18:26:33 2022 from xxx.xxx.xxx.xx

However, previously I got

Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-1017-raspi aarch64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Sun Oct 30 18:40:05 UTC 2022

  System load:           0.03271484375
  Usage of /:            21.4% of 28.76GB
  Memory usage:          5%
  Swap usage:            0%
  Temperature:           49.7 C
  Processes:             143
  Users logged in:       1
  IPv4 address for eth0: xxx
  IPv6 address for eth0: xxx

 * Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8s
   just raised the bar for easy, resilient and secure K8s cluster deployment.

   https://ubuntu.com/engage/secure-kubernetes-at-the-edge

0 updates can be applied immediately.

which I can still run by

sudo run-parts /etc/update-motd.d/

I have no idea how I changed this behaviour. I just updated the system and rebooted. Maybe it was a kernel update, because there was a dialog that asked which services should be restarted. I did not really understand what this really meant and tried to choose every service, but pressing enter was applying the choices and not choosing the service. Hence, I thought a reboot will automatically restart all the services. I found a lot of threads how to disable motd but non how to enable it. I found the entry PrintMotd no in /etc/ssh/sshd_condig and changed to yes and thought okay that is it. However this did not seem to have an effect. At least the welcome message is still not displayed.

What can I do to enable the message again?

uz flag
Jos
I notice that there is a file `/etc/default/motd-news.wasremoved` that I didn't remove (or rename) myself. That may have something to do with it.
Nathanael Skrepek avatar
ru flag
@Jos there is the file `motd-news` which `ENABLED=1` and also `WAIT=5` I tried to set the number to `100`, but this didn't help.
Nathanael Skrepek avatar
ru flag
@RobertLongson what can I do with this package?
Nathanael Skrepek avatar
ru flag
@RobertLongson it was installed and running the command did nothing.
uz flag
Jos
Do you have a `Banner` statement in your `/etc/ssh/sshd_config`? You can use that to point to a custom text file. You may need to uncomment that line and restart `sshd`.
Nathanael Skrepek avatar
ru flag
@Jos I don't know and I cannot look it up anymore, since I gave up and reinstalled ubuntu on my raspberry pi. Thanks nonetheless.
Score:0
lv flag

I met the same problem after installing a new python version 3.10 and chose this python version as the default python. I used following command line changing the python version from 3.8 to 3.10

sudo update-alternatives --config python3

Then, the problem occurred.

I think if you got the same problem as mine you can fix it by just changing the python version back to the old one.

You can check whether it is the issue of python version by using following command:

run-parts /etc/update-motd.d/

After running above command I got following warnings:

Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-1042-azure x86_64)

 * Documentation:  https://help.ubuntu.com  * Management:     https://landscape.canonical.com  * Support:        https://ubuntu.com/advantage

  System information as of Wed Jul 26 03:08:59 UTC 2023

Traceback (most recent call last):   File "/usr/bin/landscape-sysinfo", line 22, in <module>
    run(sys.argv[1:], reactor)   File "/usr/lib/python3/dist-packages/landscape/sysinfo/deployment.py", line 115, in run
    for plugin in config.get_plugins():   File "/usr/lib/python3/dist-packages/landscape/sysinfo/deployment.py", line 69, in get_plugins
    return [namedClass("landscape.sysinfo.%s.%s"   File "/usr/lib/python3/dist-packages/landscape/sysinfo/deployment.py", line 69, in <listcomp>
    return [namedClass("landscape.sysinfo.%s.%s"   File "/usr/lib/python3/dist-packages/twisted/python/reflect.py", line 173, in namedObject
    module = namedModule('.'.join(classSplit[:-1]))   File "/usr/lib/python3/dist-packages/twisted/python/reflect.py", line 159, in namedModule
    topLevel = __import__(name)   File "/usr/lib/python3/dist-packages/landscape/sysinfo/network.py", line 4, in <module>
    from netifaces import AF_INET, AF_INET6 ModuleNotFoundError: No module named 'netifaces' run-parts: /etc/update-motd.d//50-landscape-sysinfo exited with return code 1

 * Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8s    just raised the bar for easy, resilient and secure K8s cluster deployment.

   https://ubuntu.com/engage/secure-kubernetes-at-the-edge

Expanded Security Maintenance for Applications is not enabled.

0 updates can be applied immediately.

2 additional security updates can be applied with ESM Apps. Learn more about enabling ESM Apps service at https://ubuntu.com/esm

Hope above information help!

Score:0
jp flag

You should check if the files in the /etc/update-motd.d directory are executable. You can check using this command:

ls -l /etc/update-motd.d/

permissions should be -rwxr-xr-x for all files. If the permissions are different you can correct it with this command:

chmod a+x /etc/update-motd.d/*
Nathanael Skrepek avatar
ru flag
all files have `-rwxr-xr-x 1 root root` and one file even has `lrwxrwxrwx`.
lupp0l0 avatar
jp flag
have you modified the PAM configuration? try check if the file /etc/pam.d/login contains two rows like these: session optional pam_motd.so motd=/run/motd.dynamic session optional pam_motd.so noupdate
Nathanael Skrepek avatar
ru flag
Not that I know. I haven't touched this file. this two lines exist in this file: `session optional pam.motd.so motd=/run/motd.dynamic` and `session optional pam.motd.so noupdate`
lupp0l0 avatar
jp flag
ok, one last thing to try: check if the package update-motd is installed using "apt install update-motd"
Nathanael Skrepek avatar
ru flag
I wasn't installed. Now it is but it didn't solve my problem.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.