Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

marked as duplicate by slm, Bernhard, derobert, Anthon, jasonwryan Dec 30 '13 at 18:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
I don't think you want to print that particular line. :) Edited –  Karlson Dec 30 '13 at 14:51
    
This might help: askubuntu.com/questions/265072/… –  Ketan Dec 30 '13 at 14:53

3 Answers 3

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 file

share|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/
share|improve this answer

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.

share|improve this answer

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