centos7 0 安裝配置samba檔案共享服務

2021-08-04 10:53:25 字數 3243 閱讀 5216

作為依賴被安裝:

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

#  setsebool -p samba_enable_home_dirs on

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

# systemctl restart smb

# systemctl enable smb

彈出  登入視窗,輸入賬號:zyt    密碼:123

進入:home/database目錄

配置完成!





CentOS7 0安裝配置Storm集群

os hostname ipsoftware notes 1centos7 apollo.dt.com 192.168.56.181 1.zookeeper 2.storm master 2centos7 artemis.dt.com 192.168.56.182 1.zookeeper 2.sto...

CentOS 7 0安裝配置Vsftp伺服器

一 配置防火牆,開啟ftp伺服器需要的埠 centos 7.0預設使用的是firewall作為防火牆,這裡改為iptables防火牆。1 關閉firewall systemctl stop firewalld.service 停止firewall systemctl disable firewall...

CentOS 7 0安裝配置Vsftp伺服器

一 配置防火牆,開啟ftp伺服器需要的埠 centos 7.0預設使用的是firewall作為防火牆,這裡改為iptables防火牆。1 關閉firewall systemctl stop firewalld.service 停止firewall systemctl disable firewall...