一. samba的安装:
sudo apt-get install samba
sudo apt-get install smbfs
sudo apt-get install smbfs
二. 创建共享目录:
mkdir /home/phinecos/share
sodu chmod 777 /home/phinecos/share
sodu chmod 777 /home/phinecos/share
三. 创建Samba配置文件:
1. 保存现有的配置文件
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
2. 修改现配置文件
sudo gedit /etc/samba/smb.conf
在smb.conf最后添加
[share]
path = /home/phinecos/share
available = yes
browsealbe = yes
public = yes
writable = yes
path = /home/phinecos/share
available = yes
browsealbe = yes
public = yes
writable = yes
四. 创建samba帐户
sudo touch /etc/samba/smbpasswd
//2018-1-10 更新:新版本的samba已不需要,具体见
Samba用户管理
sudo smbpasswd -a phinecos //phinecos为用户名
sudo smbpasswd -a phinecos //phinecos为用户名
然后会要求你输入samba帐户的密码
[如果没有第四步,当你登录时会提示 session setup failed: NT_STATUS_LOGON_FAILURE]
五. 重启samba服务器
sudo /etc/init.d/samba restart
六. 测试
smbclient -L
//
localhost/share
七,使用
可以到windows下输入ip使用了,在文件夹处输入
"
\\
" +
"
Ubuntu机器的ip或主机名
" +
"
\\
" +
"
share
"
2018-1-10 更新:
安装smbfs的时候提示:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package smbfs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
cifs-utils:i386 cifs-utils
E: Package 'smbfs' has no installation candidate
参考这里
https://askubuntu.com/a/326573/586619
It seems smbfs is deprecated and you should use cifs instead. try :
sudo apt-get install cifs-utils