【TrueNAS】SMB 折腾

Posted by 西维蜀黍 on 2021-05-04, Last Modified on 2021-09-21

SMB Config

$ cat /usr/local/etc/smb4.confb
[global]
        workgroup = WORKGROUP
        server string = Samba Server Version %v
        netbios name = Samba
        log file = /var/log/samba/samba_log.%m
        max log size = 50
        security = user
        passdb backend = tdbsam
        smb ports = 6727
        include = /etc/samba/user/%U.smb.conf

https://www.freebsd.org/cgi/man.cgi?query=smbpasswd&format=html

修改端口

在 [global] 段添加以下代码并在路由上做好端口影射:

smb ports = 2222

这样,就可以规避 445/139 端口。 但 Windows 要将 2222 修改为默认端口好像很麻烦!

macOS 连接 SMB

smb://用户名:密码@公网IP:6727

# Or
smb://公网IP:6727

Reference