使用samba共享文件夾,提供給window訪問

1. 下載yumdownloader vim

yum install -y yum-utils

 

2. 下載sambaspa

mkdir samba

cd samba

yumdownloader --resolve avahi-autoipd samba samba-client

 

3. 安裝samba.net

yum localinstall avahi-autoipd-0.6.31-17.el7.x86_64.rpm avahi-libs-0.6.31-17.el7.x86_64.rpm cups-libs-1.6.3-29.el7.x86_64.rpm krb5-libs-1.15.1-8.el7.x86_64.rpm libldb-1.1.29-1.el7.x86_64.rpm libsmbclient-4.6.2-11.el7_4.x86_64.rpm libtalloc-2.1.9-1.el7.x86_64.rpm libtdb-1.3.12-2.el7.x86_64.rpm libtevent-0.9.31-1.el7.x86_64.rpm libwbclient-4.6.2-11.el7_4.x86_64.rpm pytalloc-2.1.9-1.el7.x86_64.rpm samba-4.6.2-11.el7_4.x86_64.rpm samba-client-4.6.2-11.el7_4.x86_64.rpm samba-client-libs-4.6.2-11.el7_4.x86_64.rpm samba-common-4.6.2-11.el7_4.noarch.rpm samba-common-libs-4.6.2-11.el7_4.x86_64.rpm samba-common-tools-4.6.2-11.el7_4.x86_64.rpm samba-libs-4.6.2-11.el7_4.x86_64.rpm

 

4. 配置sambarest

mkdir /home/share
vim /etc/samba/smb.conf
在末尾添加
[share]
    comment = share
    path = /home/share
    writable = yes
保存並關閉smb.conf

設置登陸用戶名和密碼
su root
smbpasswd -a root

 

5. 重啓sambacode

service smb restart

 

6. 訪問共享文件夾blog

\\192.168.1.100\share

 

擴展:ip

  在Centos7.2系統下已經安裝了大部分依賴庫,只須要安裝samb便可get

yum list installed | grep samba     #查看samba依賴庫版本

  而後下載samba-4.2.3-10.el7.x86_64進行安裝便可,建議下載地址:http://rpm.pbone.net/it

  建議關閉防火牆後使用:event

systemctl stop firewalld.service

  提示沒有寫入權限:

setenforce 0 //關閉SELinux
相關文章
相關標籤/搜索