If you are using the latest Ubuntu Server version, you might have noticed some promotional links in the welcome message that have nothing to do with the Ubuntu Server platform. You may already know that MOTD, which stands for Message Of The Day, is the welcome message displayed every time you log in to your Linux system. Typically, the welcome message contains the operating system version, basic system information, links to official documentation, and links about the latest security updates, etc. These are what we normally see every time we log in via SSH or locally. However, recently some additional links have appeared in the terminal welcome message. I've noticed these links a few times, but I didn't care and never clicked on them. The title image shows the 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 link to the Ubuntu wiki in the welcome message. Some people might be surprised and wonder what this is. Actually, there is no need to worry about the link in the welcome message. It may look like an ad, but it is not a commercial. The links actually point to the official Ubuntu blog and the Ubuntu wiki. As I said before, one of the links is irrelevant and does not have any details related to Ubuntu Server, that's why I called them ads at the beginning. While most of us will never visit a bit.ly link, some people might visit it out of curiosity only to be disappointed to find that it just points to an external link. You can use any URL to a shortening service like unshorten.it to see where it will lead before visiting the real link. Alternatively, you can simply type the plus sign (+) at the end of bit.ly links 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 enables administrators or distributions to add executable scripts to the /etc/update-motd.d/ location for the purpose of generating helpful, interesting messages to be displayed at login time. It was originally implemented for Landscape (Canonical's commercial service), but other distribution maintainers found it useful and adopted the feature in their own distributions as well. If you look in /etc/update-motd.d/ on a Ubuntu system, you'll see a set of scripts. One is to print a generic "Welcome" banner. The next one prints 3 links showing where to find help for the operating system. Another counts and displays the number of local system packages that can be updated. Another script tells you if you need to reboot etc. Since Ubuntu 17.04, the developers added /etc/update-motd.d/50-motd-news, a script to include some additional information in the welcome message. This additional information is: Important critical information, such as ShellShock, Heartbleed, etc. End of Life (EOL) news, new feature availability, etc. Some interesting and useful posts published in the Ubuntu official blog and other Ubuntu related news Another feature is that it is asynchronous. About 60 seconds after boot, a systemd timer runs the /etc/update-motd.d/50-motd-news –force script. It provides the three configuration variables defined in the /etc/default/motd-news script. The default values are: ENABLED=1, URLS="https://motd.ubuntu.com", WAIT="5". Following is the content of /etc/default/motd-news file: $ cat /etc/default/motd-news # Enable/disable the dynamic MOTD news service # This is a useful way to provide dynamic, informative # Information pertinent to the users and administrators # of the local system ENABLED=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 too URLS="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 login WAIT=5 The good thing is that MOTD is fully 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, a systemd timer job will loop through each URL, trim their contents to 80 characters per line, a maximum of 10 lines, and concatenate them to a cache file in Additionally # Piece together the user agent USER_AGENT="curl/$curl_ver $lsb $platform $cpu $uptime" This means that the MOTD retriever will report your OS version, hardware platform, CPU type, and uptime to Canonical. At this point, I hope you have a basic understanding of MOTD. Now let's get back to the topic, I don't want this feature. How can I disable it? If the promotional links in the welcome message still bother you and you want to disable them permanently, here’s how you can quickly disable it. Disable Ads in Terminal Welcome Message in Ubuntu Server To disable these ads, edit the file: $ sudo vi /etc/default/motd-news Find the following line and set its value to 0 (zero). [...] ENABLED=0 [...] Save and close the file. Now, reboot your system and see if the welcome message still shows the link from the Ubuntu blog. Did you see it? There are currently no links from the Ubuntu blog and the Ubuntu wiki. Summarize The above is what I introduced to you on how to disable advertisements in the terminal welcome message in Ubuntu server. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Solution to MySQLSyntaxErrorException when connecting to MySQL using bitronix
>>: Vue implements a movable floating button
Table of contents Preface Discover the cause Cust...
The computer system has been reinstalled, and the...
Background: A long time ago (2017.6.5, the articl...
Functions about null in MySql IFNULL ISNULL NULLI...
(Win7 system) VMware virtual machine installation...
First, perform a simple Docker installation. To c...
Table of contents 1. Environmental Preparation 1....
1. Download MySQL Log in to the MySQL official we...
Background description: On an existing load balan...
Inline format <colgroup>...</colgroup>...
Docker is really cool, especially because it'...
undefined In JavaScript, if we want to determine ...
We often use click events in the a tag: 1. a href=...
The query data in the xml price inquiry contains ...
In daily development tasks, we often use MYSQL...