> For the complete documentation index, see [llms.txt](https://docs.verge.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verge.io/knowledge-base/zh/storage-vsan/troubleshooting-nas-shares.md).

# NAS 共享故障排除

在本指南中，我们将逐步讲解你在使用 NAS CIFS 共享时可能遇到的常见问题，并提供分步解决方案。让我们帮助你高效地解决这些问题！

***

## 连接错误

### 问题：无法连接到 CIFS 共享

如果你在访问 CIFS 共享时遇到连接问题，可能需要在 Windows 设备上为 SMB 共享启用不安全的来宾登录。

#### 解决方案：启用不安全的来宾登录

1. **打开本地组策略编辑器**
   * 按 `Win + R` 打开“运行”对话框。
   * 类型 `gpedit.msc` 并按 `Enter` 打开本地组策略编辑器。
2. **导航到策略路径**
   * 在控制台树中，导航到 **计算机配置 > 管理模板 > 网络 > Lanman 工作站**.
3. **编辑策略设置**
   * 找到 **启用不安全的来宾登录** 在右侧窗格中。
   * 右键单击它并选择 **编辑**.
4. **启用该设置**
   * 在策略设置窗口中，选择 **已启用**.
   * 点击 **确定** 以应用更改。
5. **重启你的设备**
   * 重启你的 Windows 设备，以确保更改生效。

通过启用不安全的来宾登录，你应该能够解决 CIFS 共享的连接问题。

***

## 权限被拒绝错误

### 问题：访问 CIFS 共享时被拒绝访问

如果你遇到权限被拒绝错误，可能是由于用户权限或共享设置不正确。

#### 解决方案：验证权限和共享设置

1. **检查用户权限**
   * 确保该用户账户具有访问共享所需的权限。
   * 进入 NAS 服务并验证特定共享的用户权限。
2. **检查共享设置**
   * 确保共享设置配置正确。
   * 导航到 **NAS > Shares** 并验证特定共享的设置。
   * 确保该共享可被浏览，并且正确的用户或组拥有访问权限。
3. **强制用户/组选项**
   * 如果使用 **强制用户选项** 或 **强制组选项**，请确保指定的用户或组具有正确的访问权限。

***

## 性能缓慢

### 问题：访问 CIFS 共享速度缓慢

如果访问 CIFS 共享很慢，可能是由于网络问题或配置不正确。

#### 解决方案：优化性能设置

1. **检查网络连接**
   * 验证你的网络是否稳定，且没有连接问题。
   * 使用诸如 `ping` 或 `traceroute` 之类的工具检查网络延迟和丢包情况。
2. **调整 SMB 协议版本**
   * 确保你使用的是最优的 SMB 协议版本。
   * 导航到 **NAS > Volumes**，选择该卷，并在 **高级配置选项**.
3. **优化 NAS 配置**
   * 检查并优化 NAS 配置，例如缓存和缓冲设置。
   * 如需提高性能的高级配置选项，请咨询 VergeOS 支持。

***

## MacOS 问题

### 问题：无法从 MacOS 访问 CIFS 共享

由于 SMB 协议版本或其他配置设置的差异，MacOS 用户在尝试访问 CIFS 共享时可能会遇到问题。

#### 解决方案：调整 MacOS 设置

1. **确保 SMB 兼容性**
   * 在你的 Mac 上打开“终端”应用程序。
   * 使用以下命令检查 SMB 协议版本：

     ```bash
     smbutil statshares -a
     ```
   * 确保服务器支持 SMB2 或 SMB3，因为 SMB1 已被弃用，MacOS 可能不支持。
2. **修改 `nsmb.conf`**
   * 创建或编辑 `nsmb.conf` 文件以强制使用特定的 SMB 协议版本：

     ```bash
     sudo nano /etc/nsmb.conf
     ```
   * 添加以下行以强制使用 SMB3：

     ```ini
     [default]
     smb_neg=smb3_only
     ```
   * 保存文件并退出编辑器。
3. **清除 SMB 缓存**
   * 使用以下命令清除 SMB 缓存：

     ```bash
     sudo rm -rf /var/db/samba/*
     sudo rm -rf /var/db/smb/*
     ```
4. **重启你的 Mac**
   * 重启你的 Mac 以应用更改。

#### 解决方案：验证共享配置

1. **检查共享权限**
   * 确保 CIFS 共享权限已为 MacOS 用户正确配置。
   * 导航到 **NAS > Shares** 并验证特定共享的设置。
2. **使用正确的凭据**
   * 在提示时，确保你使用正确的用户名和密码来访问共享。
   * 如果需要匿名访问，请确保该共享允许来宾访问。

#### 解决方案：添加高级配置选项

为了更好地支持 MacOS 客户端，你可以在 CIFS 设置中的“高级配置选项”下添加特定配置。

1. **导航到 NAS CIFS 设置**
   * 前往 **NAS** 并点击仪表板上的 **CIFS** 框。
2. **添加高级配置选项**
   * 在 **高级配置选项**，添加以下设置：

     ```ini
     ea support = yes
     vfs objects = fruit streams_xattr
     fruit:metadata = stream
     fruit:model = MacSamba
     fruit:veto_appledouble = no
     fruit:nfs_aces = no
     fruit:posix_rename = yes
     fruit:zero_file_id = yes
     fruit:wipe_intentionally_left_blank_rfork = yes
     fruit:delete_empty_adfiles = yes
     ```
3. **保存并应用设置**
   * 保存更改并应用新的配置设置。

通过遵循这些故障排除步骤，你应该能够有效解决 NAS CIFS 共享的常见问题。如果你仍然遇到问题，请联系 VergeOS 支持以获得进一步帮助。

***

{% hint style="info" %}
**文档信息**

* 最后更新：2024-09-03
* VergeOS 版本：4.12.6
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.verge.io/knowledge-base/zh/storage-vsan/troubleshooting-nas-shares.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
