Ubuntu Server enable automatic security updates

System administrators should n and to apply them without fail security. If these updates are neglected, servers end up vulnerable, which could lead to attacks and data theft.

We know this is a task that can be neglected, especially when others keep coming up . So below we will see how you can enable automatic security updates on servers running with .

Connect to your server and install the unattended upgrade package with the command:

sudo apt-get install unattended-upgrades -y

Then install the common-notifier-update package for automatic restarts with the command:

 

sudo apt-get install update-notifier-common -y

Then edit the 50unattended-upgrades file with the command:

sudo nano /etc/apt/apt.conf.d/50unattended-upgrades

By default, security updates are enabled, so you do not have to deal with this section. However, you may want to enable automatic restarts.

Scroll down to this section and you can set whether the automatic restarts will take place immediately or at a specific time.

To enable automatic restarts, remove // ​​characters from the line Unattended-Upgrade :: Automatic- “false” and change false to true.

Then you can do the same in the line "Unattended-Upgrade :: Automatic-Reboot-Time" 02:00 "? and set the time you want the automatic restart to take place (so that it does not happen during a period when the server is used too much).

If you do not want to enable auto-restarts, you should at least enable auto-updates. If you now want to see if a reboot is pending on your server, give the command:

cat / var / run / reboot-required

Restart your machine, you are ready.

iGuRu.gr The Best Technology Site in Greecefgns

every publication, directly to your inbox

Join the 2.082 registrants.

Written by giorgos

George still wonders what he's doing here ...

Leave a reply

Your email address is not published. Required fields are mentioned with *

Your message will not be published if:
1. Contains insulting, defamatory, racist, offensive or inappropriate comments.
2. Causes harm to minors.
3. It interferes with the privacy and individual and social rights of other users.
4. Advertises products or services or websites.
5. Contains personal information (address, phone, etc.).