I need to display a message before any login on a Linux box, either locally and for remote login via SSH.

How can I achieve this?

Edit: Thanks for your answers. I had to pick one accepted answer, but both are correct and complement each other.

"issue" and "Banner" are the two concepts I need to use to provide a message for every user before they log into the system.

link|improve this question

feedback

2 Answers

up vote 6 down vote accepted

For local login (or telnet) you need to modify:

/etc/motd

For display a message before login you edit instead

/etc/issue

see http://www.cyberciti.biz/faq/howto-change-login-message/

link|improve this answer
+1 (motd being the abbreviation of "message of the day"). – Alain Pannetier May 30 '11 at 0:16
is the motd displayed before the user is asked for a password ? – ascobol Jun 2 '11 at 11:18
The contents of /etc/motd are displayed by login(1) after a successful login but just before it executes the login shell. – DrNoone Jun 2 '11 at 19:45
feedback

For SSH, you need to change the Banner config option in sshd_config:

http://www.cyberciti.biz/tips/change-openssh-sshd-server-login-banner.html

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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