安装了 Ubuntu 14.04。还安装了 samba、system-config-samba、samba-common-bin、samba-common、smbclient、nautilus-share、fusemb、winbind 和 cifs-utils 等。
我正在尝试让 Samba 工作。目前我的机器运行的是 Ubuntu 14.04 或 Lubuntu 14.04,但很快会添加一个 Windows 机器。我将我的工作组称为“工作组”。
安装完上面列出的所有软件包后,我认为我应该做的第一件事是确保一切正常。因此,我运行了 testparm:
main1@system1:~$ testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[printers]"
Processing section "[print$]"
Processing section "[shared_stuff]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
[global]
server string = %h server (Samba, Ubuntu)
server role = standalone server
map to guest = Bad User
obey pam restrictions = Yes
guest account = main1
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* .
username map = /etc/samba/smbusers
unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
name resolve order = bcast, host
dns proxy = No
usershare allow guests = Yes
panic action = /usr/share/samba/panic-action %d
idmap config * : backend = tdb
guest ok = Yes
[printers]
comment = All Printers
path = /var/spool/samba
create mask = 0700
printable = Yes
print ok = Yes
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
[shared_stuff]
path = /home/main1/shared_stuff
read only = No
然后我运行smbtree
,希望在输出中看到共享shared_stuff
,但却没有得到任何输出:
main1@system1:~$ smbtree
Enter main1's password:
main1@system1:~$
我在网上搜索了所有关于 smbtree 没有输出的帖子,但还是找不到问题所在。任何帮助我都会非常感激。
我还跑了smbtree -d3
:
main1@system1:~$ smbtree -d3
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
Processing section "[global]"
added interface eth0 ip=192.168.1.2 bcast=192.168.1.255 netmask=255.255.255.0
Enter main1's password:
tdb(/var/cache/samba/gencache.tdb): tdb_open_ex: could not open file /var/cache/samba/gencache.tdb: Permission denied
name_resolve_bcast: Attempting broadcast lookup for name WORKGROUP<0x1d>
samba_tevent: EPOLL_CTL_DEL EBADF for fde[0x7f06594e7800] mpx_fde[(nil)] fd[7] - disabling
name_resolve_bcast: Attempting broadcast lookup for name WORKGROUP<0x1b>
samba_tevent: EPOLL_CTL_DEL EBADF for fde[0x7f06594e7770] mpx_fde[(nil)] fd[7] - disabling
name_resolve_bcast: Attempting broadcast lookup for name __MSBROWSE__<0x1>
samba_tevent: EPOLL_CTL_DEL EBADF for fde[0x7f06594e7800] mpx_fde[(nil)] fd[7] - disabling
而且,我没有ufw
运行:
main1@system1:~$ sudo ufw status
[sudo] password for main1:
Status: inactive
答案1
您缺少该browseable
选项。如果您想查看它,则需要像这样smbtree
:
[shared_stuff]
path = /home/main1/shared_stuff
read only = No
browseable = Yes
然后执行sudo service smbd restart
,现在您可以运行smbtree
并且您将看到它。
答案2
如果你通过身份验证保护你的 smb 连接,并且 kerberos 等没有正确安装,你也会遇到同样的问题。尝试删除或注释掉如果没有其他方法,则使用以下几行:
server signing = mandatory
smb encrypt = mandatory