需求
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
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
[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
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
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:
[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: >
Password:
Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.0.10-1.4E]
smb: >
//在windows下测试..
ps:此帖绝对是本人原创...
转载时..
请注明:
转至http://blog.csdn.net/Kipen/ 作者:flyshitou(石の頭丶)
请尊重他人的劳动果实..
谢谢..
--by flyshitou (石の頭丶)
转载时..
请注明:
转至http://blog.csdn.net/Kipen/ 作者:flyshitou(石の頭丶)
请尊重他人的劳动果实..
谢谢..
--by flyshitou (石の頭丶)