1、安装 samba软件包
sudo apt-get install samba
sudo apt-get install smbclient
2、启动或停止samba服务
sudo /etc/init.d/samba start
sudo /etc/init.d/samba stop
3、安装samba管理工具
sudo apt-get install system-config-samba
4、启动samba管理工具
sudo system-config-samba
注:启动过程中可能会出现以下的错误:
Traceback (most recent call last):
File "/usr/sbin/system-config-samba", line 45, in <module>
mainWindow.MainWindow(debug_flag)
File "/usr/share/system-config-samba/mainWindow.py", line 121, in __init__
self.basic_preferences_win = basicPreferencesWin.BasicPreferencesWin(self, self.xml, self.samba_data, self.samba_backend, self.main_window)
File "/usr/share/system-config-samba/basicPreferencesWin.py", line 97, in __init__
self.admin = libuser.admin()
SystemError: could not open configuration file `/etc/libuser.conf': 没有那个文件或目录
解决方法 :手动创建libuser.conf文件
sudo touch /etc/libuser.conf
5、在启动后的界面上 "首先项"-->samba用户,添加samba用户。里边的unix用户是指当前ubuntu中存在的用户名, windows用户名和密码是从windows下访问时要用到的用户名和密码.
6 在启动后的界面上点“+”号,添加一个新的共享。在“基本”选项卡中,选中要共享的目录后,勾上“可擦写” "显示";在“访问”选项卡里,把上一步添加的用户选上。
7、修改共享目录的权限,为所有人可读写。
8 重启samba服务.
9、在windows下的资源管理器中输入linux的IP地址,如 \\192.168.216.186 ,弹出一个登录的对话框,在弹出的框里输入刚设置windows用户名和密码。
samba安装完成