首页 > 代码库 > ubuntu 配置 samba, win7 map network device from linux
ubuntu 配置 samba, win7 map network device from linux
一. samba的安装:
# sudo apt-get insall samba
# sudo apt-get install smbfs
二. 创建共享目录,或是找已经存在的文件夹,只要权限放开就行了:
# mkdir /home/username/share
# sodu chmod 777 /home/username/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/username/share
available = yes
browsealbe = yes
public = yes
writable = yes
四. 创建samba帐户
#sudo touch /etc/samba/smbpasswd
#sudo smbpasswd -a USERNAME
会要求你输入samba帐户的密码
New SMB password:
Retype new SMB password:
[如果没有第四步,当你登录时会提示 session setup failed: NT_STATUS_LOGON_FAILURE]
五. 重启samba服务器
#sudo service smbd restart
六. 测试
# smbclient -L //localhost/share
会要求输入user密码
Domain=[JERRY-DESKTOP] OS=[Unix] Server=[Samba 3.2.3]
Sharename Type Comment
--------- ---- -------
print$ Disk Printer Drivers
share Disk
IPC$ IPC IPC Service (jerry-desktop server (Samba, Ubuntu))
Domain=[JERRY-DESKTOP] OS=[Unix] Server=[Samba 3.2.3]
Server Comment
--------- -------
Workgroup Master
--------- -------
WORKGROUP
ok.
可以到windows下输入ip试一下了
在文件夹处输入 "\\" + "Ubuntu机器的ip或主机名" + "\\" + "share" (例如:\\192.168.168.168\\share)
参考:
http://blog.csdn.net/raindrophust/article/details/6249920
ubuntu 配置 samba, win7 map network device from linux