Centos samba安裝

來源:互聯網
上載者:User

標籤:samba

安裝環境:Centos6.5   iptables開啟  Selinux:Enforcing

1、安裝
yum -y install samba

2、配置文檔
vim /etc/samba/smb.conf
 [global]  #全域變數設定
 workgroup = WORKGROUP
 server string = Samba Server Version %v
 security = SHARE  #安全層級:匿名共用,還可以是user(使用者驗證),domain(域)
 log file = /var/log/samba/log.%m
 max log size = 50
 load printers = No
 idmap config * : backend = tdb
 hosts allow = 127.  192.168.1.  #設定允許訪問的範圍
 cups options = raw
 browseable = No   #列舉共用目錄(No為不列舉,yes為列舉)

[Share] #環境變數設定
 comment =  Public Share
 path = /Share  #設定共用目錄
 guest ok = Yes
 browseable = Yes

如果上面的全域變數中設定的安全層級為user,則需要設定網路使用者,下面列舉一種最簡單的驗證方式:
新增加一個
useradd pop  #增加使用者pop
su pop     #切換至pop使用者中
smbpasswd  #設定pop的smb訪問密碼,該密碼不是使用者的登機密碼,只用於samba的訪問驗證
環境變數中也要增加一項
invalid users = pop

3 、配置安全環境
    3.1 設定防火牆,samba 使用445和139連接埠
        iptables -A INPUT -s 0/0 -i eth0 -p tcp --destination-port 445 -j ACEPT  #0/0可以修改為你需要的網段,例如:192.168.1.1/24
        iptables -A INPUT -s 0/0 -i eth0 -p tcp --destination-port 139 -j ACEPT

    3.2設定Selinux
        chcon -t samba_share_t -R /Share # 參數說明:-t是添加規則,-R遞迴式修改。另外要注意的是-R一定要緊跟在在目錄的前面


Centos samba安裝

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.