我在本地服务器上安装了 samba,我们需要通过网络共享文件。它启动正常,但根本没有显示在网络上。我甚至无法通过 Linux 或 Windows 中的 IP 尝试访问它。
我没有在此服务器上设置防火墙,并且 NFS 运行正常,没有任何问题。
Ubuntu 16.04.5
这是我的配置。
[global]
server string = %h server (Samba, Ubuntu)
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* .
netbios name = myserver.local
security = user
obey pam restrictions = yes
server role = standalone server
socket options = TCP_NODELAY
interfaces = 192.0.0.0/8
pam password change = yes
passdb backend = tdbsam
map to guest = bad user
unix password sync = yes
os level = 20
encrypt passwords = yes
log file = /var/log/samba/log.%m
dns proxy = no
max log size = 1000
passwd program = /usr/bin/passwd %u
bind interfaces only = false
syslog = 0
workgroup = WORKGROUP
usershare allow guests = yes
[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
[shares]
force group = me
writeable = yes
force user = me
path = /home/me/shares
编辑:
netstat -antp
不显示smbd
。
journalctl
Oct 24 11:41:49 user systemd[1]: Starting LSB: start Samba SMB/CIFS daemon (smbd)...
Oct 24 11:41:49 user smbd[28299]: * Starting SMB/CIFS daemon smbd
Oct 24 11:41:49 user smbd[28299]: Warning: Fake start-stop-daemon called, doing nothing.
Oct 24 11:41:49 user smbd[28299]: ...done.
Oct 24 11:41:49 user systemd[1]: Started LSB: start Samba SMB/CIFS daemon (smbd).
编辑2
smbclient -L localhost
WARNING: The "syslog" option is deprecated
Connection to localhost failed (Error NT_STATUS_CONNECTION_REFUSED)
编辑3
ls /sbin/start-stop-daemon*
/sbin/start-stop-daemon /sbin/start-stop-daemon.REAL
编辑4
sudo apt install -f
Error: Server version (5.7.23-0ubuntu0.16.04.1) does not match with the version of
the server (5.7.24) with which this program was built/distributed. You can
use --skip-version-check to skip this check.
mysql_upgrade failed with exit status 3
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
我最初安装 samba 时没有遇到任何问题,并且从那时起我安装了其他软件包也没有问题,只有 samba。
答案1
看来 Ubuntu 安装有误,出于某种原因,它将启动作业链接到了虚假的启动脚本。答案是将其移至真实脚本:
sudo mv /sbin/start-stop-daemon.REAL /sbin/start-stop-daemon