Skip to content

Instantly share code, notes, and snippets.

@fly2xiang
Created March 7, 2018 03:27
Show Gist options
  • Save fly2xiang/e78e3c0bb6cc8fa0621b038cb90a0126 to your computer and use it in GitHub Desktop.
Save fly2xiang/e78e3c0bb6cc8fa0621b038cb90a0126 to your computer and use it in GitHub Desktop.
记录 Windows 10 、 Windows XP 与 Ubuntu 使用 Samba 共享文件

Samba 有多个版本

从 Windows 10 1709 秋季创意者更新开始不再安装 SMB v1 版本。

中文:https://support.microsoft.com/zh-cn/help/4034314/smbv1-is-not-installed-windows-10-and-windows-server-version-1709

英文:https://support.microsoft.com/en-us/help/4034314/smbv1-is-not-installed-windows-10-and-windows-server-version-1709

而 Windows XP 中则支持 SMB v1 版本。

参见:https://partnersupport.microsoft.com/zh-hans/par_servplat/forum/par_winserv/smb-v1%E5%92%8Csmb-v3%E7%9A%84%E5%8C%BA%E5%88%AB/9c58a810-8251-4e7c-b651-fad7f662cac7?auth=1

可为 Windows 10 打开 SMB v1 支持,可在 控制面板 -> 程序 -> 启用或关闭 Windows 功能 中, 重新安装 SMB 1.0/CIFS 文件共享支持 中的 SMB 1.0/CIFS 服务器SMB 1.0/CIFS 服务器,并删除 SMB 1.0/CIFS Automatic Removal。 安装之后重启计算机。

在 Linux 系统中可由 smbclient 访问 SMB 服务器,或者使用 mount.cifs (等同于 mount -t cifs, 包含在 cifs-utils) 挂载共享文件到文件系统中。

在使用 smbclient 时,可使用 -m|--pax-protocol 参数指定最大支持的 SMB 协议,可选值为 (NT1, SMB2, SMB3 等)。

例如连接 Windows 10 SMB 服务器时:smbclient //192.168.1.17/Share --user=foo -m SMB3

在使用 mount.cifs 时,可使用 -o 指定选项 vers 指定 SMB 版本,可选值为 (1.0, 2.0, 3.0 等)。

例如在挂载 Windows XP SMB 服务时:sudo mount -t cifs //192.168.1.17/Share /mnt/Share -o user=foo,vers=1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment