1

I would like to print something in the middle of a user login, related only to that user. In other words, this has to be after the user has typed in their username, but before they even start typing in their password. Is there a standard mechanism to do so, both for local logins and logins via SSH? In case it matters, this is on Debian Bookworm.

This question is different than Displaying server information at login prompt (Ubuntu), which is generic to all users, and other user-specific MOTD which only appear after the user has already typed in the password.

1 Answer 1

0

No, there's no standard mechanism to do so. A You would have to modify the different login programs - which is impossible for ssh, since it's the user's ssh client, not yours.

Generally, especially for ssh logins, what you want to seems a bit problematic: you'd give someone doing a port scan (and that happens several times a minute to my servers) who finds your ssh server an indication for which user names are valid.

3
  • 1
    Can't see why a PAM module couldn't do that. Commented Feb 22 at 7:06
  • @StéphaneChazelas how would that hook into say lightdm or gdm-greeter, or show something before the ssh client starts the password challenge?
    – sina bala
    Commented Feb 22 at 7:07
  • 2
    As part of the PAM conversation. Could at least change the "Password:" prompt of pam_get_authtok() Commented Feb 22 at 7:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .