Linux中samba服务器配置

注意:若是配置过程当中出现不正常现象请看文档末尾处的注意事项。html

一、将samba所须要的rpm安装包(已提供)上传linux服务器至:/usr/local/soft/linux

二、执行操做命令:vim

a、cd /usr/local/soft服务器

b、rpm -ivh samba-3.6.12-59.2.1.x86_64.rpmide

c、rpm -ivh samba-client-3.6.12-59.2.1.x86_64.rpm操作系统

三、添加自启动.net

执行命令:chkconfig –a smbhtm

四、开启防火墙例外文档

vim /etc/sysconfig/SuSEfirewall2get

使用查找命令:

分别查找

FW_SERVICES_EXT_TCP和FW_SERVICES_EXT_UDP

a、在FW_SERVICES_EXT_TCP 处添加上:13九、38九、44五、901

b、在FW_SERVICES_EXT_UDP 处添加上:13七、138

五、重启防火墙

SuSEfirewall2 stop

SuSEfirewall2 start

六、创建samba服务器目录文件:

a、执行命令:

cd /home

mkdir dl_data

chmod 555 dl_data

b、 创建各个单位的文件目录:执行命令

cd /home/dl_data

如1:大连供电车间

mkdir大连供电车间

chmod –R 777大连供电车间

如1:高铁技术科

mkdir大连供电车间

chmod –R 777高铁技术科

依上述所说:目录结构以下

权限 目录

dr-xr-xr-x –dl_data

drwxrwxrwx | –大连供电车间

drwxrwxrwx | –高铁技术科

七、添加samba用户

用户1:

添加用户:useradd user1

设置密码:passwd user1

添加user1到samba用户:smbpasswd -a user1(注意:此时须要设置samba用户密码,也是samba登陆密码)

八、配置samba配置文件:

执行命令:vim /etc/samba/smb.conf (最好先备份一下,备份命令 cp /etc/samba/smb.conf /etc/samba/smb.confcopy)

除了一下这段话,其他的所有用#号注释掉。

[global]

workgroup = WORKGROUP

passdb backend = tdbsam

printing = cups

printcap name = cups

printcap cache time = 750

cups options = raw

map to guest = Bad User

include = /etc/samba/dhcp.conf

logon path = \%L\profiles.msprofile

logon home = \%L\%U.9xprofile

logon drive = P:

usershare allow guests = Yes

添加共享文件

[高铁技术科]

comment = public

path = /home/dl_data

valid users = keshi

writable = yes

create mask = 0777

[大连供电车间]

comment = public

path = /home/dl_data/大连供电车间

valid users = shop1

writable = yes

create mask = 0777

解释:

path = /home/dl_data/大连供电车间 : 表示共享文件路径

valid users = shop1:表示只容许shop1用户登陆

writable = yes : 表示可写

注意事项:

安装时注意samba版本是否对应操做系统版本。

查看系统版本,以下

执行命令:lsb_release –a

rpm包下载地址:http://rpmfind.net/linux/rpm2html/

目录文件权限设置。

目录文件全部者、全部组设置

防火墙设置

目录是否和配置中的目录对应

smb用户密码是否正确(非系统用户)

自启动别忘了开启(不然下一次开机samba服务就未开启)
原文来自:http://www.aile.pub/295 欢迎访问博主的窝心网

相关文章
相关标签/搜索