centos中samba配置後始終連不上的絕招

來源:互聯網
上載者:User

標籤:

奶奶的,按照網上的辦法改了/etc/samba/smb.conf設定檔,結果在win7裡面死活連不上,後來發現是防火牆的問題。

有兩個命令必須要執行:

1、將SELIUNX設定成disabled或者permissive

setenforce 0

2、關閉防火牆服務

service iptables stop



若SElinux啟用中,在Windows檔案總管無法連到 Samba 所分享出來的目錄時,

在Linux 中,可執行下列指令:

setsebool -P samba_enable_home_dirs on

 

參考檔案: /etc/samba/smb.conf

#---------------
# SELINUX NOTES:
# 分享群組
# If you want to use the useradd/groupadd family of binaries pleaserun:
# setsebool -P samba_domain_controller on
#

# 分享home目錄
# 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 markit as
# "samba-share_t" so that selinux will let you write into it.
# Make sure not to do that on system directories as they mayalready 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 canuse 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/rootprexec/print command/...) please
# put them into the /var/lib/samba/scripts directory so that smbdwill be
# allowed to run them.
# Make sure you COPY them and not MOVE them so that the rightSELinux context
# is applied, to check all is ok use restorecon -R -v/var/lib/samba/scripts
#
#--------------
#



iptables開機自動啟動:開啟: chkconfig iptables on 關閉: chkconfig iptables offiptables關閉服務:開啟: service iptables start 關閉: service iptables stop



chkconfig --level 35 nmb on           

chkconfig --level 35 smb on        

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.