1.挂载光盘
2.查看是否安装samba:rpm -qa|grep samba
3.安装SMB服务器的软件依赖:rpm -ivh /media/Server/perl-Convert-ASN1-0.20-1.1.noarch.rpm
4.安装SMB:rpm -ivh /media/Server/media/Server/samba/-3.0.33-3.14.e15.i386.rpm
5.如果要安装Web配置工具samba-swat-3.0.33-3.14.el5.i386.rpm需要先安装依赖:xinetd-2.3.14-10.el.i386.rpm
SMB服务配置文件:/etc/samba/smb.conf
忽略注释行 显示配置参数:grep -v “#” /etc/samba/smb.conf |grep -v “;”
启动SMB
检查配置是否正确:testparm
启动:service smb start
重启:service smb restart
自启:ntsysv
修改主机名:/etc/sysconfig/network
设置“HOSTNAME”
pdbedit
-L 查看samba用户
-a 创建用户
-x 删除用户
Smbpasswd -a -x同理
1、关闭selinux
2、cp smb.conf smb.conf.bak
3、修改主配置文件:vim smb.conf
4、重启服务:service smb restart
[global]
workgroup=workgroup
security=share
[tmp]
path=/tmp
writable=yes
guest ok=yes
[global]
workgroup=workgroup
security=user
[homes]
comment=Home Directory
browseable=no
writable=yes
[global]
workgroup=workgroup
[homes]
comment=Home Directory
browseable=no
writable=yes
[tmp]
path=/tmp
writable=yes
[helen-jerry]
path=/var/samba/hel-jerry
valid user=helen jerry
workgroup =改为和windows一个组
server string =服务器描述
security =share
[share]
comment =描述
path =共享路径
public =yes 是否允许匿名访问
修改主配置文件vim smb.conf
Security = user
启用日志功能:去掉log file =/var/log/samba/%m.log的注释
max log size =50
[user]
comment =描述
path =共享路径
Valid user = jerry 允许访问的用户
Write list = Jerry 有写权限的用户
注意:共享目录的所属者改为允许访问的用户
chown Jerry /home/user
Smbpasswd -a jerry 添加samba用户
useradd tom
Smbpasswd -a tom
Vim smb.conf
Security =user
[homes]
Comment = Home Directories
Browseable = no其它用户不可见
Writable =yes
Valid users = %S 可用的用户
Groupadd teachers
Groupadd students
Tom jack为学生
Usermod -g students tom
Usermod -g students jack
Useradd -g teachers zhang
Useradd -g teachers wang
Smbpasswd -a zhang
Smbpasswd -a wang
Mkdir /home/student
Chgrp students /home/student/
Chmod 757 /home/student/
Chmod g+s /home/student/
Security =user
[student]
Comment =student
Path = /home/student
Valid users = @students @teachers
Write list = @teachers
Groupadd sales
Groupadd market
批量为sales组里添加用户:tom Jack
Samba服务器配置
批量为market组里添加用户zhang wang
Samba服务器配置
创建总经理
Useradd ceo
Smbpasswd -a ceo
Mkdir /home/sales
Mkdir /home/markets
Chgrp sales /home/sales
Chgrp markets /home/markets
Chmod g+s /home/sales/
Chmod g+s /home/markets/
Chown ceo /home/sales/
Chown ceo /home/markets/
Chmod 770 /home/sales/
Chmod 770 /home/markets/
Security =user
注释掉[home]和打印[print]