In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to modify the login welcome information on CentOS7. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Modify welcome information
2.1 before normal login
After the current system starts, the prompt before login is:
CentOS Linux 7 (Core) Kernel 3.10.0-693.2.2.el7.x86_64 on an x86x64
CentOS7 Custom Welcome Information before and after Login CentOS7 Custom Welcome Information before and after Login
Before logging in to the system and entering the user name, you can see the information shown in the above figure, where the linux release name, kernel version number, date, machine information and other information will be displayed. If you want to set it, open the / etc/issue file first, and you can see the descriptions of the parameters followed by such a paragraph "Welcome to-kernel":
\ d display current date;\ l display virtual console number;\ m display machine type, i.e. CPU architecture, such as i386 or x86room64 (equivalent to uname-m);\ ndisplay host network name (equivalent to uname-n);\ o display domain name;\ r display Kernel kernel version number (equivalent to uname-r);\ t display current time;\ s display current operating system name. \ U displays the number of the currently logged-in user,\ U displays the number and user of the currently logged-in user;\ v displays the version date of the current operating system
The current information is:
[root@ryan ~] # cat / etc/issue\ SKernel\ r on an\ m [root@ryan ~] #
Modified to:
[root@ryan] # cat / etc/issue\ SKernel\ r on an\ m\ t\ d [root@ryan ~] #
The modified display is as follows, with an additional time and date:
CentOS7 Custom Welcome Information before and after Login CentOS7 Custom Welcome Information before and after Login
Summary: modify the / etc/issue file.
Note: this information will only be displayed when you log in normally, but not when you connect to a remote ssh.
2.2 Welcome information settings after entering a user name in ssh
After entering the user, no welcome message is displayed, but a password prompt pops up directly.
Look at the Banner settings in / etc/ssh/sshd_config to show that the file is not currently defined:
[root@ryan ~] # cat / etc/ssh/sshd_config-n | grep-I Banner112 # no default banner path113 # Banner none
Add the corresponding Banner file path to it:
Banner / etc/ssh/banner
Then create your own / etc/ssh/banner file, which is the welcome message after entering the user name.
For example, add: Welcome to ryan's World
After modifying the / etc/ssh/sshd_config file, reload it by executing the following command:
Service sshd reload
Log in to the user name again and find that the welcome message is displayed
Login as: xxxxWelcome to ryan's Worldxxxx@xxxx's password:
Summary: modify the / etc/ssh/sshd_config file, add the Banner entry, and create the file corresponding to Banner.
Note: this information is displayed only after the user name is entered by ssh, but not after the user name is entered for normal login.
2.3 Welcome message setting after entering password for ssh
The current prompt after entering a password to log in is:
Last login: Mon Feb 26 23:01:47 2018Welcome to Alibaba Cloud Elastic Compute Service! [root@ryan ~] #
You can modify the / etc/motd file to define the welcome message after the successful login of ssh.
For example, add:
This is ryan's Server!
Is displayed as:
CentOS7 Custom Welcome Information before and after Login CentOS7 Custom Welcome Information before and after Login
Summary: modify the / etc/motd file.
Note: this information is displayed not only after ssh has successfully logged in with a password, but also after a normal login.
You can not only customize the text, but also use the function of converting text to Ascii code provided by the following website to convert the text you need into different styles of characters:
This is the end of the article on "how to modify the login welcome information in CentOS7". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.