I what to print "you are on an important server" whenever a user(any user) login to a server.

Is the way is to edit each user .cshrc file?


Let's not confuse /etc/motd with /etc/issue.net. The first one is the Linux motd, displayed whenever someone logs in (which includes physical and remote connections). The second one, on the other hand, is the default SSH banner file, which is printed along with the motd (actually, before it) whenever a SSH connection is established. When logging into the machine from its physical terminal, the SSH banner will not be displayed.

If you want to change the motd, edit /etc/motd. However, it is possible that this file is automatically modified upon boot. Check /var/run/motd.dynamic and /etc/rc.local for lines than might be editing /etc/motd. You might come across some symlinks to the file as well...

If you want to define a SSH banner file, first open your /etc/ssh/sshd_config file, and find/set the Banner parameter. The default value is commented :

#Banner /etc/issue.net

Set your banner file, create it, and place your message in it.

Concerning /etc/issue, it is printed if and only if /etc/issue.net does not exist. It is displayed on both physical and remote terminals. By the way, on most systems, /etc/issue* files are displayed after the boot sequence is complete, but before you login. On remote connections, connection and authentication usually happen one right after the other, hiding the difference between all these files.

| improve this answer | |

You may want to look at setting up /etc/issue or /etc/motd files but mostly the former.

When a user logs in /etc/issue should be displayed irrespective of the shell the user is using.

See related:

Is "/etc/issue" common for all Linux distributions?

| improve this answer | |

Please look at the contents of the following files: /etc/motd and /etc/issue.net. Typically the former file contains messages that are displayed when you locally login through the command line interfaces. The contents of the latter are typically displayed for remote logins.

Here is some sample output from /etc/issue.net:

cat  /etc/issue.net  
Ubuntu 10.04 LTS 

And from /etc/motd:

cat /etc/motd
Linux machine_name 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686 GNU/Linux
Ubuntu 10.04 LTS

Welcome to Ubuntu!
 * Documentation:  https://help.ubuntu.com/
| improve this answer | |

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