0

samba服务器的配置

已有 145 阅读此文人 - - Linux,系统管理 -

samba服务器的配置:
就介绍share和user两种

一、share:
#cd /etc/shame/
#vi smb.conf
全局配置:
********[global]**********
workgroup = WORKGROUP
server string = Samba Server Version %v
netbios name = hamiguaserver
hosts allow = 127. 192.168.22. 192.168.13.
log file = /var/log/samba/%m.log
max log size = 50
★security = share★
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = no
template shell = /bin/false
winbind use default domain = no
load printers = yes
cups options = raw
printcap name = /etc/printcap

unix charset = utf8
display charset = utf8
dos charset = cp950
name resolve order = lmhosts bcast host

共享配置:
[homes]
comment = Home Directories
browseable = no
writable = yes
valid users = %S
[public]
comment = the user groups work directory
path = /var/ftp/linux-software
public = yes
writable = yes
guest ok = yes
检查一下配置#testparm
重新启动samba主机:#service smb restart

然后设置共享文件夹的权限为755

二、user
先要建立用户跟组
#groupadd user1
#useradd -g user1 test1
在samba主机中加入这个用户设置它的密码
#smbpasswd -a test1
New SMB password:输入密码
Retype new SMB password:确认密码
Added user test1.添加用户设置密码成功
系统用户映射给samba
#cat /etc/passwd | /usr/bin/mksmbpasswd.sh > /etc/samba/smbpasswd

配置samba主机
#cd /etc/shame/
#vi smb.conf
全局配置:
********[global]**********
workgroup = WORKGROUP
server string = Samba Server Version %v
netbios name = hamiguaserver
hosts allow = 127. 192.168.22. 192.168.13.
log file = /var/log/samba/%m.log
max log size = 50
★security = user★
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
encrypt passwords=yes
smb passwd file=/etc/samba/smbpasswd
dns proxy = no
template shell = /bin/false
winbind use default domain = no
load printers = yes
cups options = raw
printcap name = /etc/printcap

unix charset = utf8
display charset = utf8
dos charset = cp950
name resolve order = lmhosts bcast host
共享配置:
[homes]
comment = Home Directories
browseable = no
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775
[public]
comment = the user groups work directory
path = /var/ftp/linux-software
public = yes
writable = yes
valid users = @user1
检查一下配置#testparm
重新启动samba主机:#service smb restart

设置共享目录的权限和更改用户组
#cd /var/ftp
#chgrp user1 linux-software
#chmod 770 linux-software

期待你一针见血的评论,Come on!

不用想啦,马上 "登录"  发表自已的想法.