Linux Login Welcome Message settings

Source: Internet
Author: User
Tags openssh server

Linux can be set to login before and after the welcome information, although there is no technical content, but it is very useful a small trick. The ability to implement a login message allows you to modify 3 files.

1,/etc/issue Local login display information, before the local logon

2,/etc/issue.net Network login display information, login and display, need to be configured by sshd

3,/ETC/MOTD often used for notification information, such as the scheduled shutdown time warning, after landing the prompt information

Let's start by looking at the contents of/etc/issue as shown in:

So what does that \ r and \m mean, you can use man pam_issue to know:

\d//          The date of the local end time ;\l          //Displays the name of the current TTY, which is the first few TTY;\m          //Display hardware architecture (i386/i486/i586/i686 ...) ;\ n          //display the host's network name;\o          //display domain name;\ r          //current system version (equivalent to uname-r)\ t          // Shows the time of the local end time;\u          //There are currently several users online. \s          //current system name; \v          //Current system version.

As for file/etc/motd, (MOTD is the abbreviation for MOTD, the message of thetoday Bulletin board), the contents of the MOTD file are displayed at the user's terminal each time the user logs on.

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,

It can also be used in Chinese, which makes it easier to read. /ETC/MOTD disadvantage is that many users now log on to the system when they choose to automatically enter the graphical interface, so this information is often not visible.

The main difference between issue and MOTD files is that when a user logs on to a local text device (such as a local terminal, a local Virtual console, etc.)

/etc/issue file content is displayed before the login prompt, and/ETC/MOTD content appears after the user successfully logs on to the system.

issue.net file (for network users only) -Displays the contents of this file if you are logged in through a remote device (such as SSH or Telnet).

When using SSH login, will not display issue information is restarted OpenSSH server by the banner property of the SSHD service sshd_config
/etc/init.d/sshd Restart
configuration decision, but I found in the test

Although the banner attribute is set but not escaped from the contents of \ R and \m in Issue.net, it is displayed directly.

The above three files, issue.net and MOTD files are displayed after login, so what is the order, I did a test, as shown:

Here the author uses Putty to log in, we can find that the contents of the Issue.net file are displayed first, and finally the content in the MOTD file is displayed.

I also use Xshell to log in, the results are the same, are displayed issue.net file content, and finally display the contents of MOTD file. The last logon information is separated from the middle .

Among the differences are:

When using putty login, when we enter the username root , we display the contents of issue.net, enter the password, and then display the MOTD content.

When you log in using Xshell, the contents of the Issue.net and MOTD files are displayed in turn only when we enter the username and password and the validation succeeds.

Settings for Linux login welcome message

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.