1./ETC/MOTD/ETC/MOTD is messageoftoday (bulletin board information), each time the user logs on, the contents of the/ETC/MOTD file are displayed in the user's terminal. The system administrator can edit the system activity message in the file, For example, the administrator notifies the user when the system is upgrading the software or hardware, when the system is maintained, and so on. If the shell supports Chinese, you can also use Chinese, which makes it easier to see. By default, the/etc/motd file is empty and can be modified for the information you want to display.
[Email protected] ~]# Vi/etc/motdhello world!
Note: Window operating system also has the relevant functions, some employees of the company's work is unified management, with Windows, when employees come in early to log on to the work machine may see some such as prompt information, the role of the/ETC/MOTD implementation is similar to it.
2./etc/issue
/etc/issue and/etc/issue. NET is the Linux terminal login welcome statement to store files,/etc/issue file usage and/ETC/MOTD files, the main difference is: When a network user or through the serial port to log on to the system,/etc/ Issue file content is displayed before the login prompt, and/ETC/MOTD content appears after the user successfully logs on to the system. (When we log in to the terminal tty1~tty6 with Ctrl+alt+f1~f7, the prompt string is displayed, which is written in/etc/ Issue, can be opened with vi/etc/issue to see)
There is also a/etc/issue. NET file, which is provided to Telnet Telnet program for use. /etc/issue files and/etc/issue by default. NET content, as needed, can be modified according to your needs.
First look at the system default file content is what.
#cat/etc/issuecentos Release 6.1 (Final) Kernel \ R on an \m (\ r and \m are both escape characters)
Commonly used escape characters:
- \d the date of the local end time
- \l shows the interface of the first terminal;
- \m Display hardware level (i386/i486/i586/i686 ...)
- \ n Displays the network name of the host
- \o Show Domain name
- \ r version of the operating system (similar to UNAME-R)
- \ t Displays the time of the local end time
- \s name of the operating system
- \v version of the operating system
The difference between/etc/issue.net and/etc/issue:/etc/issue and/etc/issue.net are welcome messages that are displayed before the system is logged in, but/etc/issue is displayed when the local terminal logs on, and/etc/ Issue.net is displayed when logging in remotely. And/etc/issue.net does not support escape characters. Remote login whether to display the welcome message also depends on the SSH configuration file,/etc/ssh/sshd_config the Banner field Note: Welcome statement is best not to write welcome such as welcome content, it is best to write "non-registered users no login" and the like warning message. Because in the United States there have been hackers because the invasion of the host wrote a "Welcome to visit" statement, in the trial was acquitted. Some other configuration files ~/.bash_logout can be written in this file (this file is a hidden file) ~/.bash_history The command history file, and all used commands are recorded in this file when it is necessary to have the system do something after exiting the login. The cache is first cached in memory and then written to this file for saving. Do the exercises below to see if you can get the pit stop you want?
Examples:
If you see the following display in the Tty3 's pit Stop screen, how can I get the following picture?
CentOS Linux 7 (Core) (Terminal:tty3)
date:2015-07-08 17:29:19
Kernel 3.10.0-229.el7.x86_64 on an x86_64
welcome!
Note that the tty3 is displayed differently on different TTY, and the date is all different after pressing [Enter] again.
For:
Very simple, with the identity of root, and refer to the above backslash function to modify the/etc/issue to become as follows (a total of five):
\s (Terminal: \l)
Date: \d \ t
Kernel \ r on an \m
welcome!
The student who once had the brother of bird in this/etc/issue to revise the information, just use the Simple English letter to make his own pit stop picture, the picture has his Chinese name! Very powerful! There are also students made similar to a very big "embarrassing" in the pit Stop screen, are very interesting!
You have to notice that there is a/etc/issue.net besides/etc/issue! What is this? This is provided for Telnet to the remote login program. When we use Telnet to connect to the host, the login screen of the host will display/etc/issue.net instead of/etc/issue!
If you want to get a message from a user, such as a message you want everyone to know, then you can add the message to/ETC/MOTD! For example: When logged in, tell the login, the system will be at a fixed time for maintenance work, you can do this (must be the identity of root to modify Oh!). ):
[Email protected] ~]# VIM/ETC/MOTD
Hello everyone,
Our server would be maintained at 2015/07/10 0:00 ~ 24:00.
Please don ' t login to server at that time. ^_^
Then when your user (including all general account and root) is logged into the console, this message will appear:
Last login:wed Jul 8 23:22:25 from 127.0.0.1
Hello everyone,
Our server would be maintained at 2015/07/10 0:00 ~ 24:00.
Please don ' t login to server at that time. ^_^
The roles and differences of Linux/etc/issue and/etc/issue.net