一、安装前准备
二、配置smb.conf
[global] #主机
workgroup = 工作组名
server string = 主机说明
netbios name = 主机名称
security = share(不进行安全登录) | user(安全登录,密码文件跟smbpasswd有关) | domain(让Samba作为PDC)
encrypt passwords = yes(输入密码) | no(不需输入密码)
smb passwd file = /etc/samba/smbpasswd 密码文件
log file = /var/log/samba/log.%m 日志文件,可更改
max log size = 0 日志文件大小,0为无限制,单位为KB
load printers = yes
printing = lprng 打印机相关
[Share Directory]
comment = 目录的说明
path = 共享名对应的真实目录
read only = 是否只读
public = 是否让所有的用户都可以登入
writable = 是否可写,如果read only=no,而writable=yes,则以writable为准
create mode = 创建新文件权限
directory mode = 创建新目录权限
下面分别举两个例子来小说明一下
1)无权限目录共享
[global]
workgroup = LinuxSir
netbios name = PC-XXX
server string = Linux Samba Server TestServer
security = share
encrypt passwords = no
[linuxsir]
path = /work
writeable = yes
browseable = yes
guest ok = yes
public = yes
2)重启samba: /etc/init.d/smb restart