首页 > 程序开发 > 综合编程 > 其他综合 >

centos7.0 安装配置samba文件共享服务

2017-07-28

centos7 0 安装配置samba文件共享服务。作为依赖被安装:pytalloc x86_64 0:2 1 6-1 el7 samba-common-libs x86_64 0:4 4 4-14 el7_3 samba-common-tools x86_64 0:4 4 4-14 el7_3 samba-libs x86_64 0:4 4 4-14 el7_3。作为依赖被升级:

作为依赖被安装:

pytalloc.x86_64 0:2.1.6-1.el7 samba-common-libs.x86_64 0:4.4.4-14.el7_3 samba-common-tools.x86_64 0:4.4.4-14.el7_3 samba-libs.x86_64 0:4.4.4-14.el7_3

作为依赖被升级:

libsmbclient.x86_64 0:4.4.4-14.el7_3 libwbclient.x86_64 0:4.4.4-14.el7_3 samba-client-libs.x86_64 0:4.4.4-14.el7_3 samba-common.noarch 0:4.4.4-14.el7_3

完毕!一、samba安装

1、切换到root账户

#su - root #切换到root账户

密码: #填写root密码

2、检查是否安装samba 服务

#rpm -qa|grep samba

3、安装samba

#yum install samba

已加载插件:fastestmirror, langpacks

Loading mirror speeds from cached hostfile

* base: mirrors.cn99.com

* extras: mirrors.cn99.com

* updates: mirrors.cn99.com

..................(省略)

作为依赖被安装:

pytalloc.x86_64 0:2.1.6-1.el7 samba-common-libs.x86_64 0:4.4.4-14.el7_3 samba-common-tools.x86_64 0:4.4.4-14.el7_3 samba-libs.x86_64 0:4.4.4-14.el7_3

作为依赖被升级:

libsmbclient.x86_64 0:4.4.4-14.el7_3 libwbclient.x86_64 0:4.4.4-14.el7_3 samba-client-libs.x86_64 0:4.4.4-14.el7_3 samba-common.noarch 0:4.4.4-14.el7_3

完毕!

(二)配置samba

1、备份samba配置文件

#cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

2、配置samba

#cat /etc/samba/smb.conf.bak | grep -v "#" | grep -v ";" | grep -v "^$" > /etc/samba/smb.conf

#cat /etc/samba/smb.conf

[global]

workgroup = SAMBA

security = user

passdb backend = tdbsam

printing = cups

printcap name = cups

load printers = yes

cups options = raw

[homes]

comment = Home Directories

valid users = %S, %D%w%S

browseable = No

read only = No

inherit acls = Yes

[printers]

comment = All Printers

path = /var/tmp

printable = Yes

create mask = 0600

browseable = No

[print$]

comment = Printer Drivers

path = /var/lib/samba/drivers

write list = root

create mask = 0664

directory mask = 0775

3、添加samba 登录账号

# pdbedit -a -u zyt #其中zyt为centos系统账号

new password: #创建samba密码

retype new password: #再次确认创建密码

Unix username: zyt

NT username:

Account Flags: [U ]

User SID: S-1-5-21-2103617759-3840797845-1460611713-1000

Primary Group SID: S-1-5-21-2103617759-3840797845-1460611713-513

Full Name: zyt

Home Directory: \\zyt\zyt

HomeDir Drive:

Logon Script:

4、配置共享目录

# mkdir /home/database

# chown -Rf zyt:zyt /home/database

# semanage fcontext -a -t samba_share_t /home/database

# restorecon -Rv /home/database

]# getsebool -a | grep samba

samba_create_home_dirs --> off

samba_domain_controller --> off

samba_enable_home_dirs --> off

samba_export_all_ro --> off

samba_export_all_rw --> off

samba_load_libgfapi --> off

samba_portmapper --> off

samba_run_unconfined --> off

samba_share_fusefs --> off

samba_share_nfs --> off

sanlock_use_samba --> off

tmpreaper_use_samba --> off

use_samba_home_dirs --> off

virt_use_samba --> off

# setsebool -P samba_enable_home_dirs on

# vim /etc/samba/smb.conf (配置目录)

# systemctl restart smb

# systemctl enable smb

在windows桌面,文件输入:\\192.168.11.200 (samba服务器地址)

弹出 登录窗口,输入账号:zyt 密码:123

进入:home/database目录

配置完成!

相关文章
最新文章
热点推荐