我最近安装了 Ubuntu 18.10 和 win10 双启动。我在家里的网络上安装了一个 linux mint,运行了一些 samba 共享,我可以从 Windows(7 和 10)和另一台 Mint 笔记本电脑上正常访问它们。
但是,我新安装的 ubuntu 就是拒绝连接这些共享。它能正常看到它们,但是当我尝试登录时,登录对话框只会在 Nautilus 中再次弹出,没有显示任何错误。我尝试在 smb.conf 中设置“guest ok = yes”,但仍然无法连接。我还尝试创建另一个 samba 用户,但仍然没有成功。
Samba 版本 4.3.11,我的配置文件如下,我唯一的共享位于最后,编辑了用户和共享名。谢谢!
## Browsing/Identification ###
# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = workgroup
# server string is the equivalent of the NT Description field
server string = %h server (Samba, Linux Mint)
#### Networking ####
; interfaces = 127.0.0.0/8 eth0
; bind interfaces only = yes
#### Debugging/Accounting ####
log file = /var/log/samba/log.%m
max log size = 1000
# syslog only = no
syslog = 0
panic action = /usr/share/samba/panic-action %d
####### Authentication #######
server role = standalone server
; passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
########## Domains ###########
; logon path = \\%N\profiles\%U
# logon path = \\%N\%U\profile
; logon drive = H:
# logon home = \\%N\%U
; logon script = logon.cmd
# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
; add group script = /usr/sbin/addgroup --force-badname %g
############ Misc ############
; include = /home/samba/etc/smb.conf.%m
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash
; usershare max shares = 100
usershare allow guests = yes
security = user
; encrypt passwords = yes
; guest ok = no
; guest account = nobody
username map = /etc/samba/smbusers
#======================= Share Definitions =======================
;[homes]
; comment = Home Directories
; browseable = no
; read only = yes
; create mask = 0700
; directory mask = 0700
; valid users = %S
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
read only = yes
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
; guest ok = no
; read only = yes
create mask = 0700
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
; browseable = yes
; read only = yes
; guest ok = no
; write list = root, @lpadmin
[My LAN share name]
path = /media/myshare/etcetcetc
writeable = yes
; browseable = yes
valid users = myuser, myuser2