Samba 启动错误

Samba 启动错误

我安装了 Samba,但是当我尝试从桌面菜单运行 Samba 时出现此错误。 *****"Invalid desktop entry file: '/usr/share/applications/system-config-samba.desktop.**"***

非常感谢您的帮助!

账单

答案1

我正在家庭网络中使用 samba 服务器,如下所述,采用密码保护方式。您也可以尝试一下。

从终端安装和删除:(使用 Samba 版本 4.3.11)


sudo apt-get remove --purge samba

但是,如果您遇到客户端问题,情况会更像这样:

sudo apt-get remove --purge smbclient libsmbclient

sudo apt-get purge samba samba-common
sudo rm -rf /etc/samba/ /etc/default/samba

再次安装

sudo apt-get install samba
sudo apt-get install smbclient libsmbclient

如何以其他方式重新安装 smb.conf

dpkg-reconfigure samba-common
or
sudo cp -a /usr/share/samba/smb.conf /etc/samba/

全新安装后重启 Ubuntu 并添加用户


root@Dell-Inspiron-3521:~# sudo smbpasswd -a username (username should be without space eg "sudo smbpasswd -a alamjitsingh")
New SMB password:
Retype new SMB password:*********
Added user alamjitsingh.*********

smb.conf 所需设置


sudo gedit /usr/share/samba/smb.conf


[global]
 workgroup = WORKGROUP
 passdb backend = tdbsam 
 security = user 

在身份验证部分,通过在代码开头添加 # 来关闭“映射到客人 = 坏用户”

#map to guest = bad user

如果不起作用,以下行是可选的

force user = alamjitsingh

最后添加您的个人代码

[Shared_drive_Name]
path = /media/alamjitsingh/Shared_drive_Name (alamjitsingh is my ubuntu username)
comment = HD Share
read only = yes
available = yes
browseable = yes
writable = no
guest ok = no
public = yes
printable = no
locking = no
strict locking = no

有用的终端命令

sudo service samba reload 
sudo service samba restar
sudo service samba stop
sudo service samba start
sudo service samba status
sudo service samba force-reload

或者

sudo /etc/init.d/smbd start
sudo /etc/init.d/smbd stop
sudo /etc/init.d/smbd restart

sudo testparm

sudo service nmbd start
sudo service smbd start

或者(通过 systemctl)

sudo systemctl restart smbd
sudo systemctl start smbd
sudo systemctl restart nmbd
sudo systemctl start nmbd

检查所需服务的状态

sudo service nmbd status
sudo service smbd status
sudo service smbd restart

了解 Samba 版本

samba -V

相关内容