In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
If you are using the latest Ubuntu server version, you may have noticed that there are some promotional links in the welcome message that are not related to the Ubuntu server platform. You probably already know that MOTD, the initials of Message Of The Day, displays a welcome message every time the Linux system logs in. Usually, the welcome message contains the operating system version, basic system information, links to official documentation, and links to the latest security updates. This is what we usually see every time we log in via SSH or locally. Recently, however, some other links have appeared in the terminal welcome message. I have noticed these links several times, but I don't care and have never clicked on them. The picture is a terminal welcome message displayed on my Ubuntu 18.04 LTS server.
As you can see in the screenshot above, there is a bit.ly link and a Ubuntu wiki link in the welcome message. Some people may be surprised and wonder what it is. In fact, there is no need to worry about the links in the welcome message. It may look like an advertisement, but it is not a commercial advertisement. The link actually points to Ubuntu's official blog and Ubuntu wiki. As I said before, one of the links is irrelevant and there are no details related to the Ubuntu server, which is why I initially called them advertisements.
Although most of us don't visit bit.ly links, some of us may visit them out of curiosity and are disappointed to find that it only points to an external link. You can use any URL to go to a short URL service, such as unshorten.it, and see where it points to before visiting the real link. Alternatively, you can simply type a plus sign (+) at the end of the bit.ly link to see their actual location and some statistics about the link.
What is MOTD and how does it work?
In 2009, Dustin Kirkland from Canonical introduced the concept of MOTD in Ubuntu. It is a flexible framework that allows administrators or distributions to add executable scripts at the / etc/update-motd.d/ location in order to generate useful and interesting messages that are displayed at login. It was originally implemented for Landscape (Canonical's business service), but other distribution maintainers found it useful and adopted this feature in their own distributions.
If you check / etc/update-motd.d/, on the Ubuntu system, you will see a set of scripts. One is to print a general-purpose "welcome" banner. The next print 3 links to show where to find help with the operating system. Another calculates and displays the number of local system packages that can be updated. Another script tells you if you need to restart and so on.
Since Ubuntu 17.04, developers have added / etc/update-motd.d/50-motd-news, which is a script to include some additional information in the welcome message. The additional information is:
Important key information, such as ShellShock, Heartbleed, etc.
Life cycle (EOL) messages, availability of new features, etc.
Some interesting and useful posts on Ubuntu's official blog and other news about Ubuntu
Another feature is asynchronous, about 60 seconds after startup, the systemd timer runs the / etc/update-motd.d/50-motd-news-force script. It provides three configuration variables defined in the / etc/default/motd-news script. The default value is ENABLED=1, URLS= "https://motd.ubuntu.com", WAIT=" 5 ".
The following is the contents of the / etc/default/motd-news file:
$cat / etc/default/motd-news# Enable/disable the dynamic MOTD news service# This isa useful way to provide dynamic, informative# information pertinent to the users and administrators# of the local systemENABLED=1# Configure the source of dynamic MOTD news# White space separated list of 0 to many news services# For security reasons, these must be https# and have a valid certificate# Canonical runs a service at motd.ubuntu.com, and you# can easily run one tooURLS= "https://motd.ubuntu.com"# Specify the time in seconds You're willing to wait for# dynamic MOTD news# Note that news messages are fetched in the background by# a systemd timer, so this should never block boot or loginWAIT=5
The good thing is that MOTD is completely customizable, so you can disable it completely (ENABLED=0), change or add scripts as you wish, change the wait time in seconds, and so on.
If MOTD is enabled, the systemd timer job loops through each URL, reducing their contents to 80 characters per line, up to 10 lines, and connecting them to the cache file in / var/cache/motd-news. This systemd timer job will run and update / var/cache/motd-news every 12 hours. After the user logs in, the contents of / var/cache/motd-news are printed to the screen. This is how MOTD works.
In addition, the / etc/update-motd.d/50-motd-news file contains a custom user agent string to report information about the computer. If you look at the / etc/update-motd.d/50-motd-news file, you will see:
# Piece together the user agentUSER_AGENT= "curl/$curl_ver $lsb $platform $cpu $uptime"
This means that the MOTD searcher will report your operating system version, hardware platform, CPU type, and uptime to Canonical.
Here, I hope you have a basic understanding of MOTD.
Now let's get back to the subject, I don't want this feature. How do I disable it? If the promotional links in the welcome message still bother you and you want to disable them permanently, you can quickly disable them in the following ways.
Disable advertisements in terminal welcome messages in the Ubuntu server
To disable these ads, edit the file:
$sudo vi / etc/default/motd-news
Locate the following line and set its value to 0 (zero).
[...] ENABLED=0 [...]
Save and close the file. Now, restart the system to see if the welcome message still displays a link from the Ubuntu blog.
Did you see that? There are no links from Ubuntu blogs and Ubuntu wiki.
Summary
The above is the editor to introduce to you how to disable the advertisement in the terminal welcome message in the Ubuntu server. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!
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.