I'm aware you can run your own scripts for the MOTD in /etc/update-motd.d
and/or /etc/motd
, but that's for displaying after a user has logged in.
The SSHD config file (/etc/ssh/sshd_config
) allows you to set an option Banner
, where it displays text before you successfully login. For example:
$ ssh user@host
This is a Banner message, that is displayed before login!
user@host's password:
As far as I know, the Banner
option can only be a text file, I don't think it's possible for it to be a shell script or a .py
file that is then run and displayed, or am I wrong?
Is there some way I can make the Banner
option execute a script and display the output before login, like I descirbed above?
Just to clarify: Like with the MOTD, this Banner script would be run on the server's end, not the client's.
I was directed to this question, but:
This doesn't happen before the password prompt shows up, but auth modules are the first ones run after the password is entered.
So it's not exactly what I'm looking for, I want the output of the script to be displayed before the password prompt. The original question is similar to what I want, however.
0 Answers