When I SSH into a server, I see the MOTD then I am in BASH. What command is running that takes care of displaying the MOTD and then starts the shell?
ssh is usually a special case — unless
UseLogin yes is specified in the
sshd_config, it does the session setup itself. Much of the session is actually managed via PAM, though.
/etc/motd is often printed by
/etc/profile or a script sourced from there; it's read by your login shell.