星期一, 3月 17, 2014

samba selinux

新的samba 伺服務設定愈來愈簡單了
什麼都不太需要做就能完成
如果還有問題,就是防火牆沒開 139 與 445
然後,輸入密碼、也能登入,就是進不去資料夾…明明權限都有
搞了半天,是selinux的權限問題,這個仔細看smb.conf裏其實有提到
os:寫英文的誰會看那麼仔細啦!!
家目錄相關的權限設定如下
# If you want to share home directories via samba please run: 
# setsebool -P samba_enable_home_dirs on 

自己在家以外的地方建資料夾,然後要開共享資料夾的權限則設定如下:
# If you create a new directory you want to share you should mark it as 
# "samba-share_t" so that selinux will let you write into it. 
# Make sure not to do that on system directories as they may already have 
# been marked with othe SELinux labels. 
# 
# Use ls -ldZ /path to see which context a directory has 
# 
# Set labels only on directories you created! 
# To set a label use the following: chcon -t samba_share_t /path 

如果是要分享系統資料夾,方法如下(基本上不會用到這個吧):
# 
# If you need to share a system created directory you can use one of the 
# following (read-only/read-write): 
# setsebool -P samba_export_all_ro on 
# or 
# setsebool -P samba_export_all_rw on 
# 
# If you want to run scripts (preexec/root prexec/print command/...) please 
# put them into the /var/lib/samba/scripts directory so that smbd will be 
# allowed to run them. 
# Make sure you COPY them and not MOVE them so that the right SELinux context 
# is applied, to check all is ok use restorecon -R -v /var/lib/samba/scripts 
關於使用者,現在都改用 pdbedit 啦,

沒有留言: