View Single Post
  #4   (View Single Post)  
Old 16th July 2018
fvgit's Avatar
fvgit fvgit is offline
Spikes in tights
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("U2hlcndvb2QgRm9yZXN0")'
Posts: 314
Default

Sometimes the solution is easier than it seems.

Instead of trying to write a classification script to be used with login.conf where I'm not exactly sure I would've really known what I'm doing, I stumbled across a much easier solution by modifying two lines in /etc/ssh/sshd_config:
Code:
(...)
PrintMotd no
Banner /etc/ssh.motd
The first line suppresses the regular system motd while the second contains a path to a different motd file that gets displayed instead.

Now the same user sees /etc/motd when logging in on the console and /etc/ssh.motd when logging in through ssh. Problem solved.

Last edited by fvgit; 16th July 2018 at 12:59 AM. Reason: typo
Reply With Quote