【原创】samba服务..

需求

1.  建立目录/home/public,实现 SMB 服务共享,共享名为 Public Dircetion,允许 manage、
tech、market 组成员能读写
2.  建立目录/home/tech,实现 SMB 服务共享,共享名为 Tech Dircetion,允许 tech 组成 员能读写
3.  建立目录/home/test,实现 SMB 服务共享,共享名为 Test  Dircetion,允许 test 组成 员能读写,其他成员只能浏览 

环境情况

1. 操作系统:red hat as 4.0
2. 服务器软件包:
samba-3.0.10-1.4E
system-config-samba-1.2.21-1
samba-client-3.0.10-1.4E
samba-common-3.0.10-1.4E

实验的配置文件

1./etc/samba/smb.conf
2./etc/samba/smbpasswd
3./etc/samba/smbusers
4./etc/samba/lmhosts


//查看samba服务包是否安装,以下情况说明已经安装:
[root@localhost ~]# rpm -qa|grep samba
samba-client-3.0.10-1.4E
samba-3.0.10-1.4E
system-config-samba-1.2.21-1
samba-common-3.0.10-1.4E

//创建目录public,tesh,test...

[root@localhost ~]# mkdir /home/tech
[root@localhost ~]# mkdir /home/test
[root@localhost ~]# mkdir /home/public

//修改/etc/samba/smb.conf配置文件

[root@localhost ~]# vi /etc/samba/smb.conf  //配置文件
   [public]
   path = /home/public
   write list=@manage,@tech,@market
   public = yes
   only user=yes
   create mode=777
   directory mode=777

[tech]
   valid users=@tech
   path=/home/tech
   write list=@tech
   only user=yes
   create mode=777
   directory mode=77

[test]
   valid users=@manage,@tech,@market
   path=/home/test
   write list=@test
   only user=yes
   create mode=777
   directory mode=777

//启动服务...

[root@localhost ~]#service smb restart

//查看smb服务驱动的状态..

[root@localhost ~]# testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[public]"
WARNING: The "only user" option is deprecated
Processing section "[tech]"
WARNING: The "only user" option is deprecated
Processing section "[test]"
WARNING: The "only user" option is deprecated
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

//创建smb用户,并修改smb用户密码...

[root@localhost ~]# useradd tian     //创建tian用户
[root@localhost ~]# smbpasswd -a tian   //给用户设置samba密码
New SMB password:
Retype new SMB password:
Added user tian.

[root@localhost ~]# groupadd tech      //创建tech组
[root@localhost ~]# usermod -G tech tian   //用户tian添加到tech组中...

[root@localhost ~]# cat /etc/samba/smbpasswd
nobody:99:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[DU         ]:LCT-00000000:
tian:502:3C7AD91E2888F0DEAAD3B435B51404EE:300B1137CEA4B55C0B5A670B6503B878:[U          ]:LCT-4559D965:

//在LINUX下测试..

[root@localhost ~]# smbclient //192.168.1.77/public -U tian
Password:
Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.0.10-1.4E]
smb: >

//在windows下测试..

.

 

ps:此帖绝对是本人原创...

转载时..
请注明:
转至http://blog.csdn.net/Kipen/   作者:flyshitou(石の頭丶)
请尊重他人的劳动果实..
谢谢..

 --by flyshitou (石の頭丶)

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值