【原創】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 (石の頭丶)

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章