smb配置(一)

來源:互聯網
上載者:User

1:第一我們先確定下是不是selinux的問題:
1.1顯示目前使用者的Selinux contex

#id -Z

1.2查看selinux狀態

#sestatus -bv 

1.3:我們可以暫時關閉selinux來使用samba伺服器:

#setenforce 0
 
( #setenforce 1   --- 開啟selinux)
2我們來設定下samba(在映像介面下這一步更簡單)
編輯/etc/samba/smb.conf 檔案!
在最下面添加:

[gongxiang]
  path = /gongxiang
  writeable = yes
;  browseable = yes
  valid users = gongxiang        #在此操作之前我們已經建立立了一個帳戶名稱是:共用的普通帳戶,並且去、約定他對此目錄有完全許可權!

 

3  我們來取消selinux對samba的限制!
3.1查看SELinux對samba的設定

[root@host ~]# getsebool -a|grep samba
samba_enable_home_dirs --> off
samba_share_nfs --> off
use_samba_home_dirs --> off

 
3.2取消SELinux對samba的限制

[root@host ~]# setsebool  -P samba_enable_home_dirs 1

 
3.3我們再查看SELinux對samba的設定

[root@host ~]# getsebool -a|grep samba
samba_enable_home_dirs --> on
samba_share_nfs --> off
use_samba_home_dirs --> off

3.4重啟samba服務

[root@host ~]# service smb restart

3.5:這個命令是重新開啟SELinux對samba的限制(呵呵,你不用smba的時候使用把)

[root@host ~]# setsebool  -P samba_enable_home_dirs 0

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.