Neither OpenSSH, nor Dropbear show /etc/issue(.net) by default:
The default configs provided by Debian (which we do not touch in this regards) do not change this. I guess it is seen as information leak which must be disabled until the admin manually changes it.
In case of Dropbear: /etc/default/dropbear contain the DROPBEAR_BANNER option which allows to define a banner file.
In case of OpenSSH: /etc/ssh/sshd_config has the Banner option to do so.
[hr]
/etc/motd on OpenSSH is controlled by the PrintMotd option in /etc/ssh/sshd_config, which defaults to “yes”: https://manpages.debian.org/buster/openssh-server/sshd_config.5.en.html#PrintMotd_2
But this option is overwritten by the official Debian openssh-server package’s /etc/ssh/sshd_config to PrintMotd no, and hence on DietPi since we do not touch this setting.
In case of Dropbear, /etc/motd is printed by default, unless the -m option is passed or it is disabled at compile time. Even without printing the DietPi banner, I cannot see /etc/motd, even that neither the “-m” flag is passed, nor can I find a compile time option in the Debian build logs that would actively disable it. But I found an interesting upstream changelog: https://github.com/mkj/dropbear/blob/master/CHANGES#L81
That is from 2020.79, hence newer than what Debian Buster ships. Tested on Debian Bullseye, and voila:
Using username "root".
Authenticating with public key "Micha-20200711"
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
─────────────────────────────────────────────────────
DietPi v7.0.-1 (dev) : 16:11 - Tue 02/23/21
─────────────────────────────────────────────────────
- FQDN/hostname : VM-Bullseye
- LAN IP : 192.168.1.23 (eth0)
- Freespace (RootFS) : 6.9G
- MOTD : Please help testing DietPi beta v7.0.0:
https://github.com/MichaIng/DietPi/issues/4121
─────────────────────────────────────────────────────
DietPi Team : MichaIng (lead), Daniel Knight (founder), Joulinar (support)
Image : DietPi Core Team (pre-image: Debian mini.iso)
Web : https://dietpi.com | https://twitter.com/DietPi_
Patreon Legends : Camry2731
Donate : https://dietpi.com/#donate
DietPi Hosting : Powered by https://myvirtualserver.com
2021-02-23 16:11:25 root@VM-Bullseye:~#
Since there is no option to explicitly enable /etc/motd on Dropbear, if it is required, OpenSSH would need to be used on Debian Buster, and the default configuration file adjusted as mentioned above.
[hr]
That the /etc/motd and likely the mail hints are printed before the DietPi banner, and hence moved into scrollback buffer, is indeed an issue. Three solutions I can think of:
- Integrating those into the DietPi banner, which means that we would need to maintain a set of possible bash/shell prints.
- Integrating the DietPi banner into /etc/motd, which means that we need to dynamically update that file.
- Do not move the current screen content into the scrollback buffer when printing the DietPi banner, which means that the screen after login still contains the /etc/issue(.net) (when enabled on SSH server), login prompt + input, /etc/motd (when not disabled on SSH server) and then the DietPi banner. This would be the easiest solution, but it’s probably user-preference. We could make it an option in the dietpi-banner menu .
Barney
If you still run the DietPi system, it would be great to know whether the assumption is right that the mail hint is indeed printed before the DietPi banner, and hence can be seen when scolling up after SSH login, similar like the SSH login prompt + /etc/motd output in my paste above.