mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-21 02:10:11 +08:00
PRF&PUB:20170530 How to Fix SambaCry Vulnerability (CVE-2017-7494) in Linux Systems.md
@geekpi
This commit is contained in:
parent
dad45cd231
commit
57f01777e0
@ -1,8 +1,7 @@
|
||||
Linux 系统中修复 SambaCry 漏洞(CVE-2017-7494)
|
||||
Linux 系统中修复 SambaCry 漏洞(CVE-2017-7494)
|
||||
============================================================
|
||||
|
||||
|
||||
Samba 很久以来是为 *nix 系统上的 Windows 客户端提供共享文件和打印服务的标准。家庭用户,中型企业和大型公司都在使用它,它作为最佳解决方案在不同操作系统共存的环境中脱颖而出。
|
||||
Samba 很久以来一直是为 *nix 系统上的 Windows 客户端提供共享文件和打印服务的标准。家庭用户,中型企业和大型公司都在使用它,它作为最佳解决方案在多种操作系统共存的环境中脱颖而出。
|
||||
|
||||
由于广泛使用的工具很可能发生这种情况,大多数 Samba 安装都面临着可能利用已知漏洞的攻击的风险,这个漏洞直到 WannaCry 勒索软件攻击的新闻出来之前都被认为是不重要的。
|
||||
|
||||
@ -22,13 +21,13 @@ Debian、Ubuntu、CentOS 和 Red Hat 已采取快速的行动来保护它们的
|
||||
|
||||
如先前提到的那样,根据你之前安装的方法有两种方式更新:
|
||||
|
||||
如果你从发行版的仓库中安装的 Samba。
|
||||
#### 如果你从发行版的仓库中安装的 Samba
|
||||
|
||||
让我们看下在这种情况下你需要做什么:
|
||||
|
||||
#### 在 Debian 下修复 Sambacry
|
||||
**在 Debian 下修复 SambaCry**
|
||||
|
||||
添加下面的行到你的源列表中(/etc/apt/sources.list)以确保 [apt][2] 能够获得最新的安全更新:
|
||||
添加下面的行到你的源列表中(`/etc/apt/sources.list`)以确保 [apt][2] 能够获得最新的安全更新:
|
||||
|
||||
```
|
||||
deb http://security.debian.org stable/updates main
|
||||
@ -49,11 +48,11 @@ deb-src http://security.debian.org/ stable/updates main
|
||||
|
||||

|
||||
|
||||
在 Debian 中修复 Sambacry
|
||||
*在 Debian 中修复 SambaCry*
|
||||
|
||||
#### 在 Ubuntu 中修复 Sambacry
|
||||
**在 Ubuntu 中修复 SambaCry**
|
||||
|
||||
要开始修复,如下检查新的可用软件包并更新 samba 软件包:
|
||||
要开始修复,如下检查新的可用软件包并更新 Samba 软件包:
|
||||
|
||||
```
|
||||
$ sudo apt-get update
|
||||
@ -76,7 +75,7 @@ $ sudo apt-get install samba
|
||||
$ sudo apt-cache show samba
|
||||
```
|
||||
|
||||
#### 在 CentOS/RHEL 7 中修复 Sambacry
|
||||
**在 CentOS/RHEL 7 中修复 SambaCry**
|
||||
|
||||
在 EL 7 中打过补丁的 Samba 版本是 samba-4.4.4-14.el7_3。要安装它,这些做:
|
||||
|
||||
@ -93,19 +92,19 @@ $ sudo apt-cache show samba
|
||||
|
||||

|
||||
|
||||
在 CentOS 中修复 Sambacry
|
||||
*在 CentOS 中修复 SambaCry*
|
||||
|
||||
旧支持的 CentOS 以及 RHEL 更老的版本也有修复。参见 [RHSA-2017-1270][4] 获取更多。
|
||||
|
||||
##### 如果你从源码安装的 Samba
|
||||
#### 如果你从源码安装的 Samba
|
||||
|
||||
注意:下面的过程假设你先前从源码构建的 Samba。强烈建议你在部署到生产服务器之前先在测试环境尝试。
|
||||
|
||||
额外地,开始之前确保你备份了 smb.conf 文件。
|
||||
此外,开始之前确保你备份了 `smb.conf` 文件。
|
||||
|
||||
在这种情况下,我们也会从源码编译并更新 Samba。然而在开始之前,我们必须先确保安装了所有的依赖。注意这也许会花费几分钟。
|
||||
|
||||
#### 在 Debian 和 Ubuntu 中:
|
||||
**在 Debian 和 Ubuntu 中:**
|
||||
|
||||
```
|
||||
# aptitude install acl attr autoconf bison build-essential \
|
||||
@ -118,7 +117,7 @@ python-all-dev python-dev python-dnspython python-crypto xsltproc \
|
||||
zlib1g-dev libsystemd-dev libgpgme11-dev python-gpgme python-m2crypto
|
||||
```
|
||||
|
||||
#### 在 CentOS 7 或相似的版本中:
|
||||
**在 CentOS 7 或相似的版本中:**
|
||||
|
||||
```
|
||||
# yum install attr bind-utils docbook-style-xsl gcc gdb krb5-workstation \
|
||||
@ -129,7 +128,7 @@ libacl-devel libaio-devel libblkid-devel libxml2-devel openldap-devel \
|
||||
pam-devel popt-devel python-devel readline-devel zlib-devel
|
||||
```
|
||||
|
||||
停止服务:
|
||||
停止服务(LCTT 译注:此处不必要):
|
||||
|
||||
```
|
||||
# systemctl stop smbd
|
||||
@ -171,25 +170,24 @@ pam-devel popt-devel python-devel readline-devel zlib-devel
|
||||
|
||||
这里返回的应该是 4.6.4。
|
||||
|
||||
### 概论
|
||||
### 其它情况
|
||||
|
||||
如果你使用的是不受支持的发行版本,并且由于某些原因无法升级到最新版本,你或许要考虑下面这些建议:
|
||||
|
||||
* 如果 SELinux 是启用的,你是受保护的!
|
||||
* 如果 SELinux 是启用的,你是处于保护之下的!
|
||||
* 确保 Samba 共享是用 `noexec` 选项挂载的。这会阻止二进制文件从被挂载的文件系统中执行。
|
||||
|
||||
* 确保 Samba 共享是用 noexec 选项挂载的。这会阻止二进制文件从被挂载的文件系统中执行。
|
||||
|
||||
还有将
|
||||
还有将:
|
||||
|
||||
```
|
||||
nt pipe support = no
|
||||
```
|
||||
|
||||
添加到 smb.conf 的 [global] 字段中。你或许要记住,根据 Samba 项目,这“或许禁用 Windows 客户端的某些功能”。
|
||||
添加到 `smb.conf` 的 `[global]` 字段中。你或许要记住,根据 Samba 项目,这“或许禁用 Windows 客户端的某些功能”。
|
||||
|
||||
重要:注意 “nt pipe support = no” 选项会禁用 Windows 客户端的共享列表。比如:当你在一台 Samba 服务器的 Windows Explorer 中输入 \\10.100.10.2\ 时,你会看到 “permission denied”。Windows 客户端不得不手动执行共享,如 \\10.100.10.2\share_name 来访问共享。
|
||||
重要:注意 `nt pipe support = no` 选项会禁用 Windows 客户端的共享列表。比如:当你在一台 Samba 服务器的 Windows Explorer 中输入 `\\10.100.10.2\` 时,你会看到 “permission denied”。Windows 客户端不得不手动执行共享,如 `\\10.100.10.2\share_name` 来访问共享。
|
||||
|
||||
##### 总结
|
||||
### 总结
|
||||
|
||||
在本篇中,我们已经描述了 SambaCry 漏洞以及如何减轻影响。我们希望你可以使用这个信息来保护你负责的系统。
|
||||
|
||||
@ -199,16 +197,15 @@ nt pipe support = no
|
||||
|
||||
作者简介:
|
||||
|
||||
|
||||
Gabriel Cánepa 是一名 GNU/Linux 系统管理员,阿根廷圣路易斯 Villa Mercedes 的 web 开发人员。他为一家国际大型消费品公司工作,在日常工作中使用 FOSS 工具以提高生产力,并从中获得极大乐趣。
|
||||
|
||||
--------------
|
||||
|
||||
via: https://www.tecmint.com/fix-sambacry-vulnerability-cve-2017-7494-in-linux/
|
||||
|
||||
作者:[Gabriel Cánepa ][a]
|
||||
作者:[Gabriel Cánepa][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
Loading…
Reference in New Issue
Block a user