Score:1

No sys info on SSH login after disabling password login on Ubuntu 18.04

in flag

In an attempt to improve security on Ubuntu 20.04 server I disabled pw login follwing this article: https://www.cyberciti.biz/faq/how-to-disable-ssh-password-login-on-linux/

It works, but the sysinfo does not show up anymore on SSH login:

% ssh server
Last login: Sun Mar  6 21:07:05 2022 from 77.2.170.244

The steps included:

$ sudo vi /etc/ssh/sshd_config

ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no
PermitRootLogin no
PermitRootLogin prohibit-password

How can I reenable landscape-sysinfo ?

A.B avatar
cl flag
A.B
UsePAM no probably disabled several features like motd
merlin avatar
in flag
You are right, setting it to yes will bring it back. However the entire purpose of this is then ruled out as it will allow login via pw again. Is there any way around this?
Zareh Kasparian avatar
us flag
please let me know what do you mean by sysinfo? what type of info you need to be displayed after login ?
Score:0
cl flag
A.B

What is taken by one hand can be provided back by the other:

  • UsePAM no

    disables everything usually handled by PAM. This include this piece of configuration in /etc/pam.d/sshd:

    # Print the message of the day upon successful login.
    # This includes a dynamically generated part from /run/motd.dynamic
    # and a static (admin-editable) part from /etc/motd.
    session    optional     pam_motd.so  motd=/run/motd.dynamic
    session    optional     pam_motd.so noupdate
    
  • One can enable back a part of it with PrintMotd yes:

    Specifies whether sshd(8) should print /etc/motd when a user logs in interactively. (On some systems it is also printed by the shell, /etc/profile, or equivalent.) The default is yes.

    This option is specifically set to no on systems where UsePAM yes is set (such as Debian or Ubuntu) to avoid a double motd on login. It can be enabled back. There won't be the dynamic part (which among other things might display the number of packages that can be upgraded).

So you should change the configuration to also have PrintMotd yes.

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.