我已经安装了一个新的Linux Debian lenny服务器,它将是一个LAMP和一个Subversion服务器。 我是否必须启用自动更新?
如果我启用它,我相信我有最新的安全补丁。 因为Debian stable只提供安全补丁,所以也不能破坏我的系统。 如果我手动安装它们,那么在多天和一周的时间里,我可能会面临很高的安全风险。
请记住,我不是全职系统pipe理员,所以我没有时间查看安全公告。
你通常在你的服务器上做什么? 你有什么build议?
(有关自动升级的警告已经被以前的海报声明。
考虑到Debian安全团队在过去几年的良好logging,我认为升级失败的风险远远低于在很less访问的系统上自动更新的好处。
Debian Lenny带有无人值守升级 ,它源于Ubuntu,被认为是Debian从Lenny / 5.0开始的无人值守升级事实上的解决scheme。
要在Debian系统上运行并运行,需要安装unattended-upgrades
软件包。
然后将这些行添加到/etc/apt/apt.conf
:
APT :: Periodic :: Update-Package-Lists“1”; APT :: Periodic ::无人值守升级“1”;
(注意:在Debian Squeeze / 6.0中没有/etc/apt/apt.conf
,首选的方法是使用下面的命令,它将在/etc/apt/apt.conf.d/20auto-upgrades
🙂
sudo dpkg-reconfigure -plow无人值守升级
然后每晚运行一个cron作业,并检查是否有需要安装的安全更新。
可以在/var/log/unattended-upgrades/
监视/var/log/unattended-upgrades/
。 要小心,要使内核安全修复程序变为活动状态,需要手动重新启动服务器。 这也可以在计划的(例如每月)维护窗口中自动完成。
Apt现在自带cron作业/etc/cron.daily/apt,在文件中find文档:
#set -e # # This file understands the following apt configuration variables: # # "APT::Periodic::Update-Package-Lists=1" # - Do "apt-get update" automatically every n-days (0=disable) # # "APT::Periodic::Download-Upgradeable-Packages=0", # - Do "apt-get upgrade --download-only" every n-days (0=disable) # # "APT::Periodic::AutocleanInterval" # - Do "apt-get autoclean" every n-days (0=disable) # # "APT::Periodic::Unattended-Upgrade" # - Run the "unattended-upgrade" security upgrade script # every n-days (0=disabled) # Requires the package "unattended-upgrades" and will write # a log in /var/log/unattended-upgrades # # "APT::Archives::MaxAge", # - Set maximum allowed age of a cache package file. If a cache # package file is older it is deleted (0=disable) # # "APT::Archives::MaxSize", # - Set maximum size of the cache in MB (0=disable). If the cache # is bigger, cached package files are deleted until the size # requirement is met (the biggest packages will be deleted # first). # # "APT::Archives::MinAge" # - Set minimum age of a package file. If a file is younger it # will not be deleted (0=disable). Usefull to prevent races # and to keep backups of the packages for emergency.
只需安装apticron并在/etc/apticron/apticron.conf中更改EMAIL =设置即可
Apticron将检查最新的更新并下载它们。 它不会安装它们。 它将向您发送正在等待更新的邮件。
我的build议是,自动获取安全更新。 大约4年前,我有一个专门的Debian服务器,没有自动更新。 我在圣诞节前后度过了一个蠕虫,它利用了发行版中已知的漏洞(不记得是哪一个)。 当我从假期返回时,我的服务器被黑了。
对我来说,破解应用程序的风险非常低,远远低于运行具有众所周知的漏洞的版本所侵入的风险。
我从来没有使用自动更新。 我喜欢升级,当我周围有时间清理事情,如果出错。 如果您不想处理安全公告,请确定在检查更新和每周更新之间多长时间。 就像“aptitude update; aptitude dist-upgrade(或aptitude safe-upgrade)”一样简单
我宁愿花一点时间来让这个邮件服务器突然消失而不自动恢复。
我build议你configurationapt来每天检查更新,但只是通知你,他们可用,而不是执行它们,直到你在附近。 apt-get升级永远有可能会破坏某些东西,或者需要一些用户input。
apticron是一个很好的包,可以为你做这件事,或者你可以做一个cron作业来执行如下的事情:
apt-get update -qq; apt-get upgrade -duyq
我会build议您随时升级,看看高优先级或更高优先级 – 但是我也不想等到有30或40次升级才能执行 – 因为如果出现问题,就很难缩小哪个软件包会打破您的系统。
另外,根据您在LAMP服务器上运行的软件包,您可能希望将debian volitile和/或dotdeb存储库添加到您的存储库列表中,因为它们比debian的标准软件仓库更多地放在修补程序和病毒码更新上面。
我们使用cron-apt来自动下载,根据我在SF上看到的build议,我们现在在cron-aptconfiguration文件中包含一个只包含安全库的源列表,因此只有安全修复程序会自动安装,而不需要任何进一步的操作。
当有新的更新时,我会通过电子邮件发出警报,而且当我有时间时,我会手动进行更新。 感谢您的build议。