I've run into a problem where I'm getting two printouts of my /etc/motd file on Gentoo Linux. sshd is doing one of the printouts, and I can toggle that by configuring /etc/ssh/sshd_config, but I can't find out who's printing the second copy. I can't disable sshd from printing out the motd due to an audit requirement. I'm running the bash shell, for what it's worth
Any ideas who's printing the second copy? I don't think it's bash, as when I change /etc/passwd to use /bin/ksh for my shell, I still get the motd displayed.
It's not /etc/issue, as that contains the string "This is \n (\s \m \r) (\l)", which is printed only when you're sitting in front of the machine.
Looks like the answer was in the /etc/pam.d/login and /etc/pam.d/system-login files. I had to comment out the pam_motd.so lines.