构建Samba服务器实现Linux和Windows系统之间共享文件(2)

 

 

首页服务器应用

背景:

阅读新闻

构建Samba服务器实现Linux和Windows系统之间共享文件的互访

[日期:2012-05-04]   来源:Linux社区  作者:haoxiaoyang   [字体:]  

4:创建共享的目录,并设置相应的权限
[root@ ~]# mkdir /tmp/abc
[root@ ~]# mkdir /tmp/user1
[root@ ~]# mkdir /tmp/user2
[root@ tmp]# ll -d /tmp/abc/ /tmp/user1 /tmp/user2
drwxr-xr-x 2 root root 4096 Apr 14 13:10 /tmp/abc/
drwxr-xr-x 2 root root 4096 Apr 14 13:12 /tmp/user1
drwxr-xr-x 2 root root 4096 Apr 14 13:12 /tmp/user2
[root@ tmp]# chown user1.user1 /tmp/user1
[root@ tmp]# chown user2.user2 /tmp/user2
[root@ tmp]# ll -d /tmp/abc/ /tmp/user1 /tmp/user2
drwxr-xr-x 2 root root 4096 Apr 14 13:10 /tmp/abc/
drwxr-xr-x 2 user1 user1 4096 Apr 14 13:12 /tmp/user1
drwxr-xr-x 2 user2 user2 4096 Apr 14 13:12 /tmp/user2
[root@ ~]# cd /tmp/abc/
[root@ abc]# touch p1.txt
[root@ abc]# cd /tmp/user1
[root@ user1]# touch f1.txt
[root@ user1]# cd /tmp/user2
[root@ user2]# touch f2.txt

4:修改主配置文件

[root@ ~]# vim /etc/samba/smb.conf
290 [public]
291 comment = Public'share
292 path = /tmp/abc
293 public = yes
294 ; writable = yes
295 ; printable = no
296 ; write list = +staff
297
298 [smbuser1]
299 comment = smbuser1
300 path = /tmp/user1
301 valid users=user1
302 writable = yes
303 ; printable = no
304 ; write list = +staff
305
306 [smbuser2]
307 comment = smbuser2
308 path = /tmp/user2
309 valid users=user2
310 writable = yes
5:测试语法
[root@ ~]# testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[public]"
Processing section "[smbuser1]"
Processing section "[smbuser2]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
[global]
workgroup = MYGROUP
server string = Samba Server Version %v
passdb backend = tdbsam
cups options = raw
[homes]
comment = Home Directories
read only = No
browseable = No
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No
[public]
comment = Public'share
path = /tmp/abc
guest ok = Yes
[smbuser1]
comment = smbuser1
path = /tmp/user1
valid users = user1
read only = No
[smbuser2]
comment = smbuser2
path = /tmp/user2
valid users = user2
read only = No

6:重新启动该服务
[root@ ~]# service smb restart
Shutting down SMB services: [ OK ]
Shutting down NMB services: [ OK ]
Starting SMB services: [ OK ]
Starting NMB services:

使用windows server 2003 进行访问

1:通过网上邻居进行访问

User1用户

构建Samba服务器实现Linux和Windows系统之间共享文件

构建Samba服务器实现Linux和Windows系统之间共享文件

构建Samba服务器实现Linux和Windows系统之间共享文件

构建Samba服务器实现Linux和Windows系统之间共享文件

 

LB群集--lvs-dr模型

源码实现Postfix的页面管理和虚拟域即账号的功能

相关资讯       samba 

   

本文评论   查看全部评论 (0)


评论声明

尊重网上道德,遵守中华人民共和国的各项有关法律法规

承担一切因您的行为而直接或间接导致的民事或刑事法律责任

本站管理人员有权保留或删除其管辖留言中的任意内容

本站有权在网站内转载或引用您的评论

参与本评论即表明您已经阅读并接受上述条款

 

 

 

最新资讯

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/ca43fffb6dff1d81b952317497001a8d.html