The method of Centos/rhel system update security patch

Source: Internet
Author: User
Tags valid email address
Configuring automatic security updates on CENTOS/RHEL7 systems

On the Centos/rhel 7/6 system, you need to install the following installation package:

# yum Update-y; Yum Install Yum-cron-y

After the installation is complete, open/etc/yum/yum-cron.conf, and then find the following lines, and you must make sure that their values are the same as those shown below

Update_messages = yes
download_updates = yes
apply_updates = yes

The first line indicates that the Automatic Update command line should look like this:

# Yum--security Upgrade

Other lines ensure that you can notify and automatically download and install security upgrades.
To enable notifications from root@localhost to be sent to the same account via email (again, you can choose another account, if you wish), the following lines are also required.

Emit_via = Email
email_from = Root@localhost
email_to = root
Enable automatic security update on Centos/rhel 6

By default, the cron task is configured to download and install all updates immediately, but we can change this behavior by changing the following two parameters to Yes in the/etc/sysconfig/yum-cron configuration file.

# do not install, only check (valid value: Yes|no)
check_only=yes
# do not install, only do check and download (valid value: Yes|no)
# request Check_only=yes (first check before you know what to download)
Download_only=yes

In order to enable mail notifications about installation package updates, you need to set the mailto parameter to a valid email address.

# MAILTO is not set by default, Crond will send output to himself
# (execute cron user, here is root)
# example: Mailto=root
mailto=admin@tecmint.com

Finally, open and enable the Yum-cron service:

-------------on Centos/rhel 7-------------
systemctl start Yum-cron
systemctl enable Yum-cron
---------- ---on Centos/rhel 6-------------
# service Yum-cron start
# chkconfig--level Yum-cron on

Congratulations, you have successfully set up an automatic upgrade on the Centos/rhel 7/6 system. Summarize

In this article, we discussed how to keep your server updated or upgraded to the latest security patches on a regular basis. In addition, to ensure that you know when new patches are applied, you also learn how to configure email notifications.

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.