yum install samba samba-client samba-swat
samba-common-3.6.9-151.el6.x86_64 //主要提供samba服务器的设置文件与设置文件语法检验程序testparm
samba-client-3.6.9-151.el6.x86_64 //客户端软件,主要提供linux主机作为客户端时,所需要的工具指令集
samba-swat-3.6.9-151.el6.x86_64 //基于https协议的samba服务器web配置界面
samba-3.6.9-151.el6.x86_64 //服务器端软件,主要提供samba服务器的守护程序,共享文档,日志的轮替,开机默认选项
rpm -qa | grep samba
samba-winbind-clients-3.6.23-20.el6.x86_64
samba-3.6.23-20.el6.x86_64
samba-client-3.6.23-20.el6.x86_64
samba-winbind-3.6.23-20.el6.x86_64
samba-common-3.6.23-20.el6.x86_64
samba-swat-3.6.23-20.el6.x86_64
/etc/samba/smb.conf
[global]
Workgroup = WORKGROUP
server string = Samba Server Version %v
netbios name = Samba
log file = /var/log/samba/log.%m
security = share
client lanman auth = Yes
[public]
comment = Public Stuff
path = /share
public = yes
guet ok = yes
browseable = yes
writable = yes
available = yes
[homes]
comment = Home Directories
read only = No
browseable = no
writable = yes
valid users = %S
valid users = WORKGROUP\%S
browseable = No
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
print ok = Yes
browseable = yes
// 将share目录授权为nobody权限,任何用户都可以对其进行访问 //
chown -R nobody:nobody share
service smb start
service nmb start
chkconfig smb on
chkconfig nmb on
//通过testparm来验证刚修改的smb.conf是否配置有错//
testparm
smbclient //192.168.1.112/public
================================
将hr部的资料存放在samba服务器的/hr 目录中集中管理,以便hr人员浏览,并且该目录只允许hr部员工访问
1.hr组以及hr组的组员
groupadd HR
useradd -g HR baxk
useradd -g HR anni
mkdir /HR
刚才建立的两个帐户添加到samba的账户中,通过 smbpasswd -a USER姓名 命令
smbpasswd -a baxk
smbpasswd -a anni
[global]
workgroup = WORKGROUP
server string = David Samba Server Version %v
netbios name = DavidSamba
log file = /var/log/samba/log.%m
security = user
[homes] //设置用户宿主目录
comment = Home Directories
browseable = no
writable = yes
valid users = %S
valid users = WORKGROUP\%S
[public]
comment = Public Stuff
path = /share
public = yes
[hr] //hr 组目录,只允许hr组成员访问
comment = HR
path = /HR
writable = yes
valid users = @HR // 这个表示只有hr组的成员才能够访问hr目录