After 'dup'ing my TW system yesterday, I logged in this morning over ssh, and had this weird feeling I was missing something. After some more trials, I spotted it - the MOTD "Have a lot of fun" is gone ? In earlier times, it was in /etc/motd, which was part of 'openSUSE-release', but it's no longer there. I see the text in '/usr/lib/motd.d/welcome' though. -- Per Jessen, Zürich (15.5°C)
Per Jessen composed on 2022-04-14 09:19 (UTC+0200):
After 'dup'ing my TW system yesterday, I logged in this morning over ssh, and had this weird feeling I was missing something. After some more trials, I spotted it - the MOTD "Have a lot of fun" is gone ?
In earlier times, it was in /etc/motd, which was part of 'openSUSE-release', but it's no longer there. I see the text in '/usr/lib/motd.d/welcome' though.
Is issue-generator installed? -- Evolution as taught in public schools is, like religion, based on faith, not based on science. Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata
Felix Miata wrote:
Per Jessen composed on 2022-04-14 09:19 (UTC+0200):
After 'dup'ing my TW system yesterday, I logged in this morning over ssh, and had this weird feeling I was missing something. After some more trials, I spotted it - the MOTD "Have a lot of fun" is gone ?
In earlier times, it was in /etc/motd, which was part of 'openSUSE-release', but it's no longer there. I see the text in '/usr/lib/motd.d/welcome' though.
Is issue-generator installed?
Yep, it is. -- Per Jessen, Zürich (16.9°C)
Per Jessen wrote:
Felix Miata wrote:
Per Jessen composed on 2022-04-14 09:19 (UTC+0200):
After 'dup'ing my TW system yesterday, I logged in this morning over ssh, and had this weird feeling I was missing something. After some more trials, I spotted it - the MOTD "Have a lot of fun" is gone ?
In earlier times, it was in /etc/motd, which was part of 'openSUSE-release', but it's no longer there. I see the text in '/usr/lib/motd.d/welcome' though.
Is issue-generator installed?
Yep, it is.
office25:/etc/pam.d # cat ../issue Welcome to openSUSE Tumbleweed 20220411 - Kernel \r (\l). eth0: \4{eth0} \6{eth0} I guess that is used when you log in on a virtual console. If I have read it correctly, the motd is generated/printed by pam_motd, which I see referred to in /usr/etc/pam.d/{login,sshd} - that seems okay. -- Per Jessen, Zürich (17.2°C) Member, openSUSE Heroes.
Per Jessen composed on 2022-04-14 09:33 (UTC+0200):
Felix Miata wrote:
Is issue-generator installed?
Yep, it is.
If it's installed, then creating regular file /etc/motd should restore the traditional behavior. -- Evolution as taught in public schools is, like religion, based on faith, not based on science. Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata
On Thu, Apr 14, 2022 at 10:53 AM Felix Miata
Per Jessen composed on 2022-04-14 09:33 (UTC+0200):
Felix Miata wrote:
Is issue-generator installed?
Yep, it is.
If it's installed, then creating regular file /etc/motd should restore the traditional behavior.
How is /etc/issue related to /etc/motd?
Am Donnerstag, 14. April 2022, 09:58:14 CEST schrieb Andrei Borzenkov:
On Thu, Apr 14, 2022 at 10:53 AM Felix Miata
wrote: Per Jessen composed on 2022-04-14 09:33 (UTC+0200):
Felix Miata wrote:
Is issue-generator installed?
Yep, it is.
If it's installed, then creating regular file /etc/motd should restore the traditional behavior.
How is /etc/issue related to /etc/motd?
Both have the same purpose: tell the user something. /etc/issue is printed at the login prompt and can not be skipped, /etc/motd is printed **after** login and can be individually turned off. cheers MH -- Mathias Homann Mathias.Homann@openSUSE.org OBS: lemmy04 Jabber (XMPP): lemmy@tuxonline.tech Matrix: @mathias:eregion.de IRC: [Lemmy] on liberachat and ircnet (bouncer active) keybase: https://keybase.io/lemmy gpg key fingerprint: 8029 2240 F4DD 7776 E7D2 C042 6B8E 029E 13F2 C102
On 4/14/22 02:29, Mathias Homann wrote:
Am Donnerstag, 14. April 2022, 09:58:14 CEST schrieb Andrei Borzenkov:
On Thu, Apr 14, 2022 at 10:53 AM Felix Miata
wrote: Felix Miata wrote:
Is issue-generator installed? Yep, it is. If it's installed, then creating regular file /etc/motd should restore the
Per Jessen composed on 2022-04-14 09:33 (UTC+0200): traditional behavior. How is /etc/issue related to /etc/motd? Both have the same purpose: tell the user something.
/etc/issue is printed at the login prompt and can not be skipped, /etc/motd is printed **after** login and can be individually turned off.
And we use /etc/issue to display our usage agreement that the user acknowledges by continuing to login. We use zenity for graphical logins for the same function. Zenity offers a button to click for acknowledgement. Regards, Lew
Felix Miata wrote:
Per Jessen composed on 2022-04-14 09:33 (UTC+0200):
Felix Miata wrote:
Is issue-generator installed?
Yep, it is.
If it's installed, then creating regular file /etc/motd should restore the traditional behavior.
Yes, it did - still, according to the man page for 'pam_motd', it should have looked for an motd in /usr/lib/motd.d/ - which has one file, 'welcome'. (with "Have a lot of fun" ). -- Per Jessen, Zürich (18.2°C)
On Thu, Apr 14, 2022 at 10:58 AM Per Jessen
Yes, it did - still, according to the man page for 'pam_motd', it should have looked for an motd in /usr/lib/motd.d/ - which has one file, 'welcome'. (with "Have a lot of fun" ).
It does it here on TW 20220312 when logging in over ssh. Do you have anything in /etc/motd.d? What are permissions of file(s) in /usr/lib/motd.d? What is in /etc/pam.d/sshd (if it exists)?
Andrei Borzenkov wrote:
On Thu, Apr 14, 2022 at 10:58 AM Per Jessen
wrote: Yes, it did - still, according to the man page for 'pam_motd', it should have looked for an motd in /usr/lib/motd.d/ - which has one file, 'welcome'. (with "Have a lot of fun" ).
It does it here on TW 20220312 when logging in over ssh. Do you have anything in /etc/motd.d? What are permissions of file(s) in /usr/lib/motd.d? What is in /etc/pam.d/sshd (if it exists)?
/etc/motd.d - is empty. /etc/pam.d/sshd - does not exist. per@office25:~> l /usr/lib/motd.d/ total 40 drwxr-xr-x 2 root root 16 Apr 13 10:16 ./ dr-xr-xr-x 59 root root 4096 Apr 13 10:32 ../ -rw-r--r-- 1 root root 21 Apr 12 07:38 welcome -- Per Jessen, Zürich (17.8°C)
Can confirm, I've just updated to TW 20220412 and I've still got a lot of fun. It would be really sad if this would go away. But thankfully it did not :-) Am 14.04.22 um 10:12 schrieb Per Jessen:
Andrei Borzenkov wrote:
On Thu, Apr 14, 2022 at 10:58 AM Per Jessen
wrote: Yes, it did - still, according to the man page for 'pam_motd', it should have looked for an motd in /usr/lib/motd.d/ - which has one file, 'welcome'. (with "Have a lot of fun" ).
It does it here on TW 20220312 when logging in over ssh. Do you have anything in /etc/motd.d? What are permissions of file(s) in /usr/lib/motd.d? What is in /etc/pam.d/sshd (if it exists)?
/etc/motd.d - is empty. /etc/pam.d/sshd - does not exist.
per@office25:~> l /usr/lib/motd.d/ total 40 drwxr-xr-x 2 root root 16 Apr 13 10:16 ./ dr-xr-xr-x 59 root root 4096 Apr 13 10:32 ../ -rw-r--r-- 1 root root 21 Apr 12 07:38 welcome
Bernd Ritter wrote:
Can confirm, I've just updated to TW 20220412 and I've still got a lot of fun.
It would be really sad if this would go away. But thankfully it did not :-)
That is weird. Ah, 20220412 - I'm on 20220411. I guess it got fixed in the meantime :-) Heisenbug. -- Per Jessen, Zürich (17.2°C)
Per Jessen wrote:
Bernd Ritter wrote:
Can confirm, I've just updated to TW 20220412 and I've still got a lot of fun.
It would be really sad if this would go away. But thankfully it did not :-)
That is weird.
Ah, 20220412 - I'm on 20220411. I guess it got fixed in the meantime :-) Heisenbug.
FWIW, I've just dup'ed to 20220412 - no change, still no fun. Anyway, I guess it's a local issue. -- Per Jessen, Zürich (17.6°C)
On Thu, Apr 14, 2022 at 11:13 AM Per Jessen
Andrei Borzenkov wrote:
On Thu, Apr 14, 2022 at 10:58 AM Per Jessen
wrote: Yes, it did - still, according to the man page for 'pam_motd', it should have looked for an motd in /usr/lib/motd.d/ - which has one file, 'welcome'. (with "Have a lot of fun" ).
It does it here on TW 20220312 when logging in over ssh. Do you have anything in /etc/motd.d? What are permissions of file(s) in /usr/lib/motd.d? What is in /etc/pam.d/sshd (if it exists)?
/etc/motd.d - is empty. /etc/pam.d/sshd - does not exist.
And /usr/etc/pam.d/sshd? Does it include pam_motd?
per@office25:~> l /usr/lib/motd.d/ total 40 drwxr-xr-x 2 root root 16 Apr 13 10:16 ./ dr-xr-xr-x 59 root root 4096 Apr 13 10:32 ../ -rw-r--r-- 1 root root 21 Apr 12 07:38 welcome
Andrei Borzenkov wrote:
On Thu, Apr 14, 2022 at 11:13 AM Per Jessen
wrote: Andrei Borzenkov wrote:
On Thu, Apr 14, 2022 at 10:58 AM Per Jessen
wrote: Yes, it did - still, according to the man page for 'pam_motd', it should have looked for an motd in /usr/lib/motd.d/ - which has one file, 'welcome'. (with "Have a lot of fun" ).
It does it here on TW 20220312 when logging in over ssh. Do you have anything in /etc/motd.d? What are permissions of file(s) in /usr/lib/motd.d? What is in /etc/pam.d/sshd (if it exists)?
/etc/motd.d - is empty. /etc/pam.d/sshd - does not exist.
And /usr/etc/pam.d/sshd? Does it include pam_motd?
Yes, it looks good: office25:~ # grep motd /usr/etc/pam.d/sshd session optional pam_motd.so -- Per Jessen, Zürich (16.8°C)
On Thu, Apr 14, 2022 at 12:06 PM Per Jessen
Andrei Borzenkov wrote:
On Thu, Apr 14, 2022 at 11:13 AM Per Jessen
wrote: Andrei Borzenkov wrote:
On Thu, Apr 14, 2022 at 10:58 AM Per Jessen
wrote: Yes, it did - still, according to the man page for 'pam_motd', it should have looked for an motd in /usr/lib/motd.d/ - which has one file, 'welcome'. (with "Have a lot of fun" ).
It does it here on TW 20220312 when logging in over ssh. Do you have anything in /etc/motd.d? What are permissions of file(s) in /usr/lib/motd.d? What is in /etc/pam.d/sshd (if it exists)?
/etc/motd.d - is empty. /etc/pam.d/sshd - does not exist.
And /usr/etc/pam.d/sshd? Does it include pam_motd?
Yes, it looks good:
office25:~ # grep motd /usr/etc/pam.d/sshd session optional pam_motd.so
It is possible that something creates /run/motd.d/welcome. Anything in this directory? ... it still works after update to 20220412, so I guess it is strace time ...
Andrei Borzenkov wrote:
On Thu, Apr 14, 2022 at 12:06 PM Per Jessen
wrote: Andrei Borzenkov wrote:
On Thu, Apr 14, 2022 at 11:13 AM Per Jessen
wrote: Andrei Borzenkov wrote:
On Thu, Apr 14, 2022 at 10:58 AM Per Jessen
wrote: Yes, it did - still, according to the man page for 'pam_motd', it should have looked for an motd in /usr/lib/motd.d/ - which has one file, 'welcome'. (with "Have a lot of fun" ).
It does it here on TW 20220312 when logging in over ssh. Do you have anything in /etc/motd.d? What are permissions of file(s) in /usr/lib/motd.d? What is in /etc/pam.d/sshd (if it exists)?
/etc/motd.d - is empty. /etc/pam.d/sshd - does not exist.
And /usr/etc/pam.d/sshd? Does it include pam_motd?
Yes, it looks good:
office25:~ # grep motd /usr/etc/pam.d/sshd session optional pam_motd.so
It is possible that something creates /run/motd.d/welcome. Anything in this directory?
Nope, it's empty.
... it still works after update to 20220412, so I guess it is strace time ...
Yeah - I guess a new sshd is forked when I log in, so I ought to be able grab hold of that. -- Per Jessen, Zürich (20.1°C) http://www.cloudsuisse.com/ - your owncloud, hosted in Switzerland.
Per Jessen wrote:
... it still works after update to 20220412, so I guess it is strace time ...
Yeah - I guess a new sshd is forked when I log in, so I ought to be able grab hold of that.
That was easy to do, but after some googling I became aware of the sshd config options "PrintMotd" and "PrintLastlog". I don't recall ever having touched them before, but sure enough - they are both set to 'no' in /usr/etc/ssh/sshd_config. That file is dated 2 April, in fact everything in /usr/etc/ssh/ is dated 2 April. Here is something funny - I uncommented those two lines: #PrintMotd no #PrintLastlog no and decided to reboot. On the next login over ssh: per@localhost:~> ssh office25 Last login: Thu Apr 14 13:33:35 CEST 2022 from 192.168.3.68 on pts/1 Last login: Thu Apr 14 13:44:54 2022 from 192.168.3.68 a) why _two_ lines with Last login? b) how can there be two different timestamps? c) still no motd :-) Comparing to an older TW system, the lines with pts/1 is new. -- Per Jessen, Zürich (20.2°C)
On 2022-04-14 13:49, Per Jessen wrote:
Per Jessen wrote:
...
Here is something funny - I uncommented those two lines:
#PrintMotd no #PrintLastlog no
and decided to reboot.
You should them to "yes".
On the next login over ssh:
per@localhost:~> ssh office25 Last login: Thu Apr 14 13:33:35 CEST 2022 from 192.168.3.68 on pts/1 Last login: Thu Apr 14 13:44:54 2022 from 192.168.3.68
a) why _two_ lines with Last login? b) how can there be two different timestamps? c) still no motd :-)
Comparing to an older TW system, the lines with pts/1 is new.
-- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
Carlos E. R. wrote:
On 2022-04-14 13:49, Per Jessen wrote:
Per Jessen wrote:
...
Here is something funny - I uncommented those two lines:
#PrintMotd no #PrintLastlog no
and decided to reboot.
You should them to "yes".
Why? 'yes' is the default. -- Per Jessen, Zürich (21.1°C)
On 2022-04-14 14:11, Per Jessen wrote:
Carlos E. R. wrote:
On 2022-04-14 13:49, Per Jessen wrote:
Per Jessen wrote:
...
Here is something funny - I uncommented those two lines:
#PrintMotd no #PrintLastlog no
and decided to reboot.
You should them to "yes".
Why? 'yes' is the default.
Should be, but better try. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
Carlos E. R. wrote:
On 2022-04-14 14:11, Per Jessen wrote:
Carlos E. R. wrote:
On 2022-04-14 13:49, Per Jessen wrote:
Per Jessen wrote:
...
Here is something funny - I uncommented those two lines:
#PrintMotd no #PrintLastlog no
and decided to reboot.
You should them to "yes".
Why? 'yes' is the default.
Should be, but better try.
Okay - tried it, no change, Just produces _two_ lines of "Last login", one showing the current timestamp. Two lines - something is being called twice, something that updates the last login timestamp. Still no motd. -- Per Jessen, Zürich (20.8°C)
On Thu, Apr 14, 2022 at 3:27 PM Per Jessen
Carlos E. R. wrote:
On 2022-04-14 14:11, Per Jessen wrote:
Carlos E. R. wrote:
On 2022-04-14 13:49, Per Jessen wrote:
Per Jessen wrote:
...
Here is something funny - I uncommented those two lines:
#PrintMotd no #PrintLastlog no
and decided to reboot.
You should them to "yes".
Why? 'yes' is the default.
Should be, but better try.
Okay - tried it, no change, Just produces _two_ lines of "Last login", one showing the current timestamp. Two lines - something is being called twice, something that updates the last login timestamp.
One is printed by pam_lastog and another by sshd.
Still no motd.
strace -f -o /tmp/sshd.strace -p $(systemctl -p MainPID show sshd.service | cut -d= -f2) login using ssh provide /tmp/sshd.strace
Andrei Borzenkov wrote:
strace -f -o /tmp/sshd.strace -p $(systemctl -p MainPID show sshd.service | cut -d= -f2) login using ssh provide /tmp/sshd.strace
Hehe, yeah, I've got something like that from earlier: http://files.jessen.ch/sshd2.trc This is with the original sshd_config with "printmotd no" and "printlastlog no". -- Per Jessen, Zürich (20.6°C)
On Thu, Apr 14, 2022 at 3:43 PM Per Jessen
Andrei Borzenkov wrote:
strace -f -o /tmp/sshd.strace -p $(systemctl -p MainPID show sshd.service | cut -d= -f2) login using ssh provide /tmp/sshd.strace
Hehe, yeah, I've got something like that from earlier:
http://files.jessen.ch/sshd2.trc
This is with the original sshd_config with "printmotd no" and "printlastlog no".
14053 openat(AT_FDCWD, "/usr/lib/motd.d", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 6 14053 newfstatat(6, "", {st_mode=S_IFDIR|0755, st_size=16, ...}, AT_EMPTY_PATH) = 0 14053 getdents64(6, 0x559873b70ff0 /* 3 entries */, 32768) = 80 There is one file in this directory 14053 getdents64(6, 0x559873b70ff0 /* 0 entries */, 32768) = 0 14053 close(6) = 0 14053 setfsuid(0) = 1000 14053 setfsuid(0) = 0 14053 setfsgid(0) = 100 14053 setfsgid(0) = 0 14053 setgroups(0, []) = 0 But for some reason pam_motd ignores it and goes straight to restoring privileges. What filesystem type /usr/lib/motd.d is on?
Andrei Borzenkov wrote:
On Thu, Apr 14, 2022 at 3:43 PM Per Jessen
wrote: Andrei Borzenkov wrote:
strace -f -o /tmp/sshd.strace -p $(systemctl -p MainPID show sshd.service | cut -d= -f2) login using ssh provide /tmp/sshd.strace
Hehe, yeah, I've got something like that from earlier:
http://files.jessen.ch/sshd2.trc
This is with the original sshd_config with "printmotd no" and "printlastlog no".
14053 openat(AT_FDCWD, "/usr/lib/motd.d", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 6 14053 newfstatat(6, "", {st_mode=S_IFDIR|0755, st_size=16, ...}, AT_EMPTY_PATH) = 0 14053 getdents64(6, 0x559873b70ff0 /* 3 entries */, 32768) = 80
There is one file in this directory
Yep, "welcome" - that is also as far as I got.
14053 getdents64(6, 0x559873b70ff0 /* 0 entries */, 32768) = 0 14053 close(6) = 0 14053 setfsuid(0) = 1000 14053 setfsuid(0) = 0 14053 setfsgid(0) = 100 14053 setfsgid(0) = 0 14053 setgroups(0, []) = 0
But for some reason pam_motd ignores it and goes straight to restoring privileges.
You mean setfsuid(0)=1000 and then setfsuid(0)=0 ?
What filesystem type /usr/lib/motd.d is on?
jfs. -- Per Jessen, Zürich (22.2°C)
On Thu, Apr 14, 2022 at 4:11 PM Per Jessen
What filesystem type /usr/lib/motd.d is on?
jfs.
Yes, I can reproduce it on jfs as well. pam_motd filters scandir results by filetype (regular/symlink) and jfs apparently returns nothing here tux@localhost:~> (cd /usr/lib/motd.d; ~/a.out ) --------------- nread=80 --------------- inode# file type d_reclen d_off d_name 2 directory 24 2 . 2 directory 24 3 .. 5 ??? 32 2147483647 welcome tux@localhost:~> So "welcome" has no filetype. It is not a bug, readdir() (or getdents()) is not guaranteed to return anything useful here (and POSIX does not define anything beyond name anyway). You may consider reporting it upstream (linux-pam).
Andrei Borzenkov wrote:
On Thu, Apr 14, 2022 at 4:11 PM Per Jessen
wrote: What filesystem type /usr/lib/motd.d is on?
jfs.
Yes, I can reproduce it on jfs as well. pam_motd filters scandir results by filetype (regular/symlink) and jfs apparently returns nothing here
tux@localhost:~> (cd /usr/lib/motd.d; ~/a.out ) --------------- nread=80 --------------- inode# file type d_reclen d_off d_name 2 directory 24 2 . 2 directory 24 3 .. 5 ??? 32 2147483647 welcome
That is really weird. What is special about that file? I have code that does scandir(), never had any issue. Maybe I only looked at the filenames ... Besides, I have an older system 20210503 where it works, also on jfs. Maybe that pam_motd has changed.
tux@localhost:~>
So "welcome" has no filetype. It is not a bug, readdir() (or getdents()) is not guaranteed to return anything useful here (and POSIX does not define anything beyond name anyway).
Aha. So maybe pam_motd ought to check for filetype!='directory' and then stat the files individually.
You may consider reporting it upstream (linux-pam).
Okay. Thanks for your help. -- Per Jessen, Zürich (22.8°C) Member, openSUSE Heroes.
On Thu, Apr 14, 2022 at 5:18 PM Per Jessen
Besides, I have an older system 20210503 where it works, also on jfs. Maybe that pam_motd has changed.
Could have been jfs as well. The pam_motd directories support was added in commit https://github.com/linux-pam/linux-pam/commit/f9c9c72121eada731e010ab3620762... three years ago. What version of linux-pam is on your TW that works?
Andrei Borzenkov wrote:
On Thu, Apr 14, 2022 at 5:18 PM Per Jessen
wrote: Besides, I have an older system 20210503 where it works, also on jfs. Maybe that pam_motd has changed.
Could have been jfs as well. The pam_motd directories support was added in commit
https://github.com/linux-pam/linux-pam/commit/f9c9c72121eada731e010ab3620762...
three years ago. What version of linux-pam is on your TW that works?
pam-1.5.1 per@office24:~> rpm -qi pam Name : pam Version : 1.5.1 Release : 4.2 Architecture: i586 Install Date: Tue 04 May 2021 16:53:35 CEST Group : System/Libraries Size : 1590524 License : GPL-2.0-or-later OR BSD-3-Clause Signature : RSA/SHA256, Mon 19 Apr 2021 23:47:52 CEST, Key ID b88b2fd43dbdc284 Source RPM : pam-1.5.1-4.2.src.rpm Build Date : Mon 19 Apr 2021 23:45:06 CEST Build Host : wildcard2 Packager : https://bugs.opensuse.org Vendor : openSUSE URL : http://www.linux-pam.org/ Summary : A Security Tool that Provides Authentication for Applications With some code doing scandir(), I also get filetype unknown on this system. -- Per Jessen, Zürich (23.1°C)
On 14.04.2022 17:18, Per Jessen wrote:
Besides, I have an older system 20210503 where it works, also on jfs. Maybe that pam_motd has changed.
No, welcome message was not in this file yet. --- openSUSE-release.spec (revision 1065) +++ openSUSE-release.spec (revision 1066) @@ -525,7 +525,8 @@ EOF ln -s ..%{_prefix}/lib/os-release %{buildroot}%{_sysconfdir}/os-release -echo "Have a lot of fun..." > %{buildroot}%{_sysconfdir}/motd +mkdir -p %{buildroot}%{_prefix}/lib/motd.d/ +echo "Have a lot of fun..." > %{buildroot}%{_prefix}/lib/motd.d/welcome Release r1056 is 2021-07-17, so later.
On 14.04.2022 18:03, Andrei Borzenkov wrote:
On 14.04.2022 17:18, Per Jessen wrote:
Besides, I have an older system 20210503 where it works, also on jfs. Maybe that pam_motd has changed.
No, welcome message was not in this file yet.
--- openSUSE-release.spec (revision 1065)
+++ openSUSE-release.spec (revision 1066)
@@ -525,7 +525,8 @@
EOF
ln -s ..%{_prefix}/lib/os-release %{buildroot}%{_sysconfdir}/os-release
-echo "Have a lot of fun..." > %{buildroot}%{_sysconfdir}/motd
+mkdir -p %{buildroot}%{_prefix}/lib/motd.d/
+echo "Have a lot of fun..." > %{buildroot}%{_prefix}/lib/motd.d/welcome
Release r1056 is 2021-07-17, so later.
r1066 of course.
Andrei Borzenkov wrote:
On 14.04.2022 17:18, Per Jessen wrote:
Besides, I have an older system 20210503 where it works, also on jfs. Maybe that pam_motd has changed.
No, welcome message was not in this file yet.
Ah, I see. It is the moving of the file that has caused the issue to become visible. It has probably been there all the time. Interesting. -- Per Jessen, Zürich (22.7°C)
Andrei Borzenkov wrote:
On Thu, Apr 14, 2022 at 4:11 PM Per Jessen
wrote: What filesystem type /usr/lib/motd.d is on?
jfs.
Yes, I can reproduce it on jfs as well. pam_motd filters scandir results by filetype (regular/symlink) and jfs apparently returns nothing here
tux@localhost:~> (cd /usr/lib/motd.d; ~/a.out ) --------------- nread=80 --------------- inode# file type d_reclen d_off d_name 2 directory 24 2 . 2 directory 24 3 .. 5 ??? 32 2147483647 welcome tux@localhost:~>
So "welcome" has no filetype. It is not a bug, readdir() (or getdents()) is not guaranteed to return anything useful here (and POSIX does not define anything beyond name anyway). You may consider reporting it upstream (linux-pam).
https://github.com/linux-pam/linux-pam/issues/455 -- Per Jessen, Zürich (22.6°C)
Per Jessen wrote:
Andrei Borzenkov wrote:
On Thu, Apr 14, 2022 at 4:11 PM Per Jessen
wrote: What filesystem type /usr/lib/motd.d is on?
jfs.
Yes, I can reproduce it on jfs as well. pam_motd filters scandir results by filetype (regular/symlink) and jfs apparently returns nothing here
tux@localhost:~> (cd /usr/lib/motd.d; ~/a.out ) --------------- nread=80 --------------- inode# file type d_reclen d_off d_name 2 directory 24 2 . 2 directory 24 3 .. 5 ??? 32 2147483647 welcome tux@localhost:~>
So "welcome" has no filetype. It is not a bug, readdir() (or getdents()) is not guaranteed to return anything useful here (and POSIX does not define anything beyond name anyway). You may consider reporting it upstream (linux-pam).
I also just now submitted a pull request to linux-pam. https://github.com/linux-pam/linux-pam/pull/456 -- Per Jessen, Zürich (19.1°C)
The ssh-configuration should not be touched in /usr/etc imho. It includes conf-files from /etc/ssh/sshd_config.d/. Maybe there is a file that configures this? But actually my /usr/etc/sshd/ssh/sshd_config says: PrintMotd no and I have a lot of fun both locally and per ssh. This is strange. Cheers, Bernd Am 14.04.22 um 13:49 schrieb Per Jessen:
Per Jessen wrote:
... it still works after update to 20220412, so I guess it is strace time ...
Yeah - I guess a new sshd is forked when I log in, so I ought to be able grab hold of that.
That was easy to do, but after some googling I became aware of the sshd config options "PrintMotd" and "PrintLastlog". I don't recall ever having touched them before, but sure enough - they are both set to 'no' in /usr/etc/ssh/sshd_config. That file is dated 2 April, in fact everything in /usr/etc/ssh/ is dated 2 April.
Here is something funny - I uncommented those two lines:
#PrintMotd no #PrintLastlog no
and decided to reboot.
On the next login over ssh:
per@localhost:~> ssh office25 Last login: Thu Apr 14 13:33:35 CEST 2022 from 192.168.3.68 on pts/1 Last login: Thu Apr 14 13:44:54 2022 from 192.168.3.68
a) why _two_ lines with Last login? b) how can there be two different timestamps? c) still no motd :-)
Comparing to an older TW system, the lines with pts/1 is new.
Bernd Ritter wrote:
The ssh-configuration should not be touched in /usr/etc imho. It includes conf-files from /etc/ssh/sshd_config.d/.
Maybe there is a file that configures this?
But actually my /usr/etc/sshd/ssh/sshd_config says:
PrintMotd no
and I have a lot of fun both locally and per ssh. This is strange.
When switch to a virtual console, I see the text printed by /etc/issue, but after login, only one line: Last login: Thu Apr 14 13:44:54 2022 from 192.168.3.68 No motd. -- Per Jessen, Zürich (21.1°C)
On Thu, Apr 14, 2022 at 3:11 PM Bernd Ritter
The ssh-configuration should not be touched in /usr/etc imho. It includes conf-files from /etc/ssh/sshd_config.d/.
Maybe there is a file that configures this?
But actually my /usr/etc/sshd/ssh/sshd_config says:
PrintMotd no
Yes.
and I have a lot of fun both locally and per ssh. This is strange.
Why do you expect sshd option to have any effect on pam_motd?
participants (7)
-
Andrei Borzenkov
-
Bernd Ritter
-
Carlos E. R.
-
Felix Miata
-
Lew Wolfgang
-
Mathias Homann
-
Per Jessen