You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Samba搭建NAS失败:smbclient连接报错NT_STATUS_NOT_FOUND

Samba搭建NAS失败:smbclient连接报错NT_STATUS_NOT_FOUND

我尝试用Samba搭建NAS,但似乎没办法正常运行。按照步骤配置完成后,测试共享访问时smbclient命令直接失败了,具体报错如下:

$ smbclient -U userName //SA/FSName
Password for [WORKGROUP\userName]:
do_connect: Connection to SA failed (Error NT_STATUS_NOT_FOUND)

我又用smbclient查看本地共享列表,能看到我创建的FSName共享:

$ smbclient -L localhost
Password for [WORKGROUP\userName]:

Sharename       Type      Comment
---------       ----      -------
print$          Disk      Printer Drivers
FSName          Disk
IPC$            IPC       IPC Service (computerName server (Samba, Ubuntu))
SMB1 disabled -- no workgroup available

用testparm检查配置文件,显示加载正常,服务定义也没问题:

$ testparm
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters

[global]
	log file = /var/log/samba/log.%m
	logging = file
	map to guest = Bad User
	max log size = 1000
	obey pam restrictions = Yes
	pam password change = Yes
	panic action = /usr/share/samba/panic-action %d
	passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
	passwd program = /usr/bin/passwd %u
	server role = standalone server
	server string = %h server (Samba, Ubuntu)
	unix password sync = Yes
	usershare allow guests = Yes
	idmap config * : backend = tdb

[printers]
	browseable = No
	comment = All Printers
	create mask = 0700
	path = /var/spool/samba
	printable = Yes

[print$]
	comment = Printer Drivers
	path = /var/lib/samba/printers

[FSName]
	inherit permissions = Yes
	path = /mnt/fsName/
	read only = No

共享目录的权限和挂载信息如下:

$ ls -l /mnt/
total 4
drwxrws--- 3 root groupName 4096 Jun  9  2023 fsName
$ findmnt /mnt/fsName
TARGET         SOURCE     FSTYPE OPTIONS
/mnt/fsName    /dev/md127 ext4   rw,relatime,discard,stripe=256

我不太懂SELinux,而且系统里没装semanage,应该不是这个原因导致的问题。配置完后我已经重启过机器和Samba服务了。

有意思的是,第一次启动Samba服务后,另一台Linux设备还能看到这台机器的共享,但根本访问不了,现在连共享列表都看不到了。

当前Samba版本:

$ samba --version
Version 4.15.13-Ubuntu

编辑补充信息:

  • 操作系统:Ubuntu Desktop 22.04.3 LTS
  • Samba服务进程状态:
$ sudo ps aux | grep smbd
root        1882  0.0  0.0  86756 24320 ?        Ss   Jan30   0:00 /usr/sbin/smbd --foreground --no-process-group
root        1884  0.0  0.0  84604 10156 ?        S    Jan30   0:00 /usr/sbin/smbd --foreground --no-process-group
root        1885  0.0  0.0  84612  8108 ?        S    Jan30   0:00 /usr/sbin/smbd --foreground --no-process-group
userName   10100  0.0  0.0   9212  2432 pts/0    S+   18:24   0:00 grep --color=auto smbd

备注:内容来源于stack exchange,提问作者Jacob Bischoff

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.20 10:59:33