CentOS7关闭yum自动下载更新

CentOS7最小化安装后默认yum会自动下载更新,这对许多生产系统是不需要的,可以手动关闭它


[root@engine cron.weekly]# cd /etc/yum
[root@engine yum]# ls
fssnap.d  pluginconf.d  protected.d  vars  version-groups.conf  yum-cron.conf  yum-cron-hourly.conf


编辑yum-cron.conf,将download_updates = yes改为no即可

[root@engine yum]# cat yum-cron.conf 
[commands]
#  What kind of update to use:
# default                            = yum upgrade
# security                           = yum --security upgrade
# security-severity:Critical         = yum --sec-severity=Critical upgrade
# minimal                            = yum --bugfix upgrade-minimal
# minimal-security                   = yum --security upgrade-minimal
# minimal-security-severity:Critical =  --sec-severity=Critical upgrade-minimal
update_cmd = default


# Whether a message should be emitted when updates are available,
# were downloaded, or applied.
update_messages = yes


# Whether updates should be downloaded when they are available.
download_updates = yes


# Whether updates should be applied when they are available.  Note
# that download_updates must also be yes for the update to be applied.
apply_updates = no


# Maximum amout of time to randomly sleep, in minutes.  The program
# will sleep for a random amount of time between 0 and random_sleep
# minutes before running.  This is useful for e.g. staggering the
# times that multiple systems will access update servers.  If
# random_sleep is 0 or negative, the program will run immediately.
# 6*60 = 360
random_sleep = 360




[emitters]
# Name to use for this system in messages that are emitted.  If
# system_name is None, the hostname will be used.
system_name = None


# How to send messages.  Valid options are stdio and email.  If
# emit_via includes stdio, messages will be sent to stdout; this is useful
# to have cron send the messages.  If emit_via includes email, this
# program will send email itself according to the configured options.
# If emit_via is None or left blank, no messages will be sent.
emit_via = stdio


# The width, in characters, that messages that are emitted should be
# formatted to.
ouput_width = 80




[email]
# The address to send email messages from.
email_from = root@localhost


# List of addresses to send messages to.
email_to = root


# Name of the host to connect to to send email messages.
email_host = localhost




[groups]
# NOTE: This only works when group_command != objects, which is now the default
# List of groups to update
group_list = None


# The types of group packages to install
group_package_types = mandatory, default


[base]
# This section overrides yum.conf


# Use this to filter Yum core messages
# -4: critical
# -3: critical+errors
# -2: critical+errors+warnings (default)
debuglevel = -2


# skip_broken = True
mdpolicy = group:main


# Uncomment to auto-import new gpg keys (dangerous)
# assumeyes = True

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 可以使用以下命令关闭 CentOS 7 的防火墙: 1. 停止 firewalld 服务: ``` systemctl stop firewalld ``` 2. 禁用 firewalld 服务,使其在系统启动时不再运行: ``` systemctl disable firewalld ``` 如果你想要使用 SSH 连接到 CentOS 7 服务器,你需要确保已经安装了 OpenSSH 服务器并且已经启动。你可以使用以下命令安装 OpenSSH 服务器: ``` yum install -y openssh-server ``` 然后使用以下命令启动 OpenSSH 服务器: ``` systemctl start sshd ``` 最后,你可以使用 ssh 客户端工具(如 Terminal 或 PuTTY)连接到你的 CentOS 7 服务器。 ### 回答2: 要关闭CentOS 7上的防火墙并通过SSH进行操作,您可以按照以下步骤操作: 1. 使用SSH客户端连接到CentOS 7服务器。您可以使用像PuTTY这样的工具进行连接。 2. 使用root或具有sudo访问权限的用户登录到服务器。执行以下命令以获取root权限: ```shell sudo su - ``` 3. 检查防火墙的状态。执行以下命令来查看防火墙的状态: ```shell systemctl status firewalld ``` 如果防火墙正在运行,则可以看到一条类似于"Active: active (running)"的消息。如果防火墙已经关闭,则不需要进一步操作。 4. 关闭防火墙。如果防火墙处于运行状态,执行以下命令关闭防火墙: ```shell systemctl stop firewalld ``` 这将立即停止防火墙的运行。 5. 禁用防火墙的自动启动。执行以下命令以防止防火墙在下次服务器重启时自动启动: ```shell systemctl disable firewalld ``` 这将禁用防火墙的自动启动,并确保在下次服务器启动时不会运行。 6. 确认防火墙已关闭。再次运行以下命令检查防火墙的状态: ```shell systemctl status firewalld ``` 如果防火墙已经关闭,您将看不到"Active: active (running)"的消息。 现在,您已经成功关闭CentOS 7上的防火墙,并可以通过SSH进行操作。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值