Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

That's generally /bin/login, but 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.

share|improve this answer
    
Say you are using a different shell, does ssh figure out which shell to run? –  RyanTM May 7 '11 at 0:43
    
The shell comes from /etc/passwd or LDAP (or other directory service such as NIS), along with information like your home directory, numeroc user ID, and group memberships. You may be able to determine where by inspecting /etc/nsswitch.conf, and see your entry with getent passwd $USER. –  geekosaur May 7 '11 at 0:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.