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
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Let's not confuse
/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
/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 :
Set your banner file, create it, and place your message in it.
/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.
You may want to look at setting up
/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.
Please look at the contents of the following files:
/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
cat /etc/issue.net Ubuntu 10.04 LTS
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/