运行 ubuntu 16.04。桌面。Samba 已安装,客户端正常运行。Ubuntu 可以访问 Windows 机器。问题是 Samba 服务器似乎无法正常工作。我使用了此页面上的信息https://ubuntu.com/server/docs/samba-file-server并按照那里的步骤在 Ubuntu 上配置 Samba 服务器。我使用了本指南我如何编辑 lightdm.conf 文件并保存它?并编辑了 smb.conf 文件。我使用 gedit 编辑了 conf 文件。我关闭了终端并检查了 conf 文件是否有我需要的编辑。我重新启动了服务器以确保启动时一切正常,我认为这会导致 smb.conf 文件被读取并包含我所做的更改。没有用。从 Windows 我仍然无法访问我在 smb.conf 文件中配置的共享。如能得到任何帮助,我将不胜感激。从 Windows 我得到了 Windows 无法访问和我试图访问的共享的名称。
testparm -s
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
WARNING: The "syslog" option is deprecated
Processing section "[printers]"
Processing section "[print$]"
Processing section "[share]"
Loaded services file OK.
WARNING: The 'netbios name' is too long (max. 15 chars).
Server role: ROLE_STANDALONE
# Global parameters
[global]
server string = %h server (Samba, Ubuntu)
server role = standalone server
map to guest = Bad User
obey pam restrictions = Yes
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
dns proxy = No
usershare allow guests = Yes
panic action = /usr/share/samba/panic-action %d
idmap config * : backend = tdb
[printers]
comment = All Printers
path = /var/spool/samba
create mask = 0700
printable = Yes
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
[share]
comment = Ubuntu File Server Share
path = /media/david/Elements
read only = No
create mask = 0755
guest ok = Yes
答案1
改变这个:
[share]
comment = Ubuntu File Server Share
path = /media/david/Elements
read only = No
create mask = 0755
guest ok = Yes
对此:
[share]
comment = Ubuntu File Server Share
path = /media/david/Elements
read only = No
create mask = 0755
guest ok = Yes
force user = david
然后重新启动smbd:
sudo service smbd restart
/media/david 根据设计仅允许 david 进入 Elements 文件夹。强制用户使“guest”网络用户看起来是“david” - 至少对于此共享而言。
您的机器的主机名还有另一个问题,我们可以修复这个问题,但要看这对您能有多大帮助。