天天看點

linux 與windows檔案夾共享實作 smab協定

目錄(?)[+]

一、為什麼要這麼做?

最近在做Linux下的軟體開發,但又想使用Windows下的程式設計工具“Source Insight”。

二、安裝環境

本機系統:Windows 7 旗艦版

VMware:VMware Workstation 9.0

CentOS:CentOS 6.4

網絡擴充卡設定為:NAT 轉換

三、檢視是否已經安裝“samba”

指令:rpm -qa|grep samba

輸出結果:

samba-client-3.0.33-3.28-1.el5

samba-common-3.0.33-3.28-1.el5

這裡順便說一下搭建samba伺服器所需要的基本軟體包:

1. samba——>這個軟體包包含了主要的daemon檔案(smbd和nmbd)

2. samba-common——>提供samba的主要配置檔案(smb.conf)、smb.conf文法檢測程式(testparm)等

3. samba-client——> 當linux作為samba 用戶端的時候,提供了一套所需的工具和指令。

這下看出來了吧,samba主程式根本沒有被安裝

也可以使用“service smb status”指令檢視是否已經安裝,執行該指令如果傳回“smb:unrecognized service”,說明服務沒有安裝。

四、安裝“samba”

Samba是在Linux和UNIX系統上實作SMB協定的一個免費軟體,由伺服器及用戶端程式構成。

這裡隻介紹本人的安裝過程,

詳細請參考“鳥哥的 Linux 私房菜”之“第十六章、檔案伺服器之二: SAMBA 伺服器”

可以通過CD光牒或網絡安裝 samba

1、通過網絡安裝

本人就是用的網絡安裝,雖然有點慢,但是比較簡單友善。

指令:sudo yum install samba

就一條指令就OK了。

2、通過CD光牒安裝

僅供參考,本人沒有測試過。

先把iso鏡像挂載上,一般情況下光驅的裝置辨別為/dev/hdc,

[[email protected] ~]# mkdir /mnt/temp

[[email protected] ~]#mount /dev/hdc /mnt/temp

[[email protected] ~]#ll /mnt/temp/Server | grep samba

samba-3.0.33-3.28-1.el5.i386.rpm

samba-common-3.0.33-3.28-1.el5.i386.rpm

samba-client-3.0.33-3.28-1.el5.i386.rpm

...

[[email protected] ~]#rpm -ivh /mnt/temp/Server/samba-3.0.33-3.28-1.el5.i386.rpm

error: Failed dependencies:

perl(Convert::ASN1) is needed by samba-3.0.33-3.28-1.el5.i386

又報錯了,原來是缺少所依賴的perl ASN1包。

解決方法:安裝perl-Convert-ASN1-0.20-1.1.noarch.rpm

/mnt/temp/Server/

 [[email protected] ~]#rpm -ivh /mnt/temp/Server/samba-3.0.33-3.28-1.el5.i386.rpm

這時samba就能正常安裝了。check一下成果:

[[email protected] ~]#service smb status

smbd is stopped

nmbd is stopped

這時已經沒有smb:unrecognized service 這樣的提示了。

五、配置 Samba

<span style="white-space: pre;">	</span>先在/home目錄mkdir 目錄 samba
<span style="white-space: pre;">	</span>修改 samba 權限 
<span style="white-space: pre;">	</span>chmod 0777 /home/samba      
<span style="white-space: pre;">	</span>如果需要共享的目錄已經存在 了,那麼隻修改目錄的通路權限就可以了。      

指令:sudo vi /etc/samba/smb.conf

<span style="white-space: pre;">	</span>修改幾次地方:
<span style="white-space: pre;">	</span>找到以下幾行把注釋去掉
<span style="white-space: pre;">	</span>setsebool -P samba_domain_controller on
<span style="white-space: pre;">	</span>setsebool -P samba_enable_home_dirs on
<span style="white-space: pre;">	</span>setsebool -P samba_export_all_rw on

<span style="white-space: pre;">	</span>修改  workgroup = MYGROUP 為 MYGROUP  工作組為你windows 的工作組,一般為WORKGROUP
<span style="white-space: pre;">	</span>workgroup = WORKGROUP
<span style="white-space: pre;">	</span>server string = Samba Server Version %v
<span style="white-space: pre;">	</span>netbios name = CentOSServer #網絡計算機名,可以通過它通路共享檔案如:\\CentOSServer
<span style="white-space: pre;">	</span>跟着添加這兩行
<span style="white-space: pre;">	</span>create mask = 0777
<span style="white-space: pre;">	</span>directory mask = 0777

<span style="white-space: pre;">	</span>然後在檔案最後添加這幾行

<span style="white-space: pre;">	</span>[public]
<span style="white-space: pre;">	</span>comment = public file
<span style="white-space: pre;">	</span>path = /home/samba #剛才mkdir的檔案夾
<span style="white-space: pre;">	</span>valid users = root
<span style="white-space: pre;">	</span>writable = yes
<span style="white-space: pre;">	</span>browseable = yes

<span style="white-space: pre;">	</span>:wq指令儲存退出      
<span style="white-space: pre;">	</span>下面給出我的配置檔案内容,隻貼出關鍵部分:      
<span style="white-space: pre;"></span><div class="dp-highlighter bg_plain" style="font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; width: 700.90625px; overflow: auto; padding-top: 1px; margin: 18px 0px !important; background-color: rgb(231, 229, 220);"><div class="bar" style="padding-left: 45px;"><div class="tools" style="padding: 3px 8px 10px 10px; font-stretch: normal; font-size: 9px; line-height: normal; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; border-left-width: 3px; border-left-style: solid; border-left-color: rgb(108, 226, 108); background-color: rgb(248, 248, 248);"><strong>[plain]</strong> <a target=_blank href="http://blog.csdn.net/testcs_dn/article/details/19758163#" target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  class="ViewSource" title="view plain" style="color: rgb(160, 160, 160); text-decoration: none; border: none; padding: 1px; margin: 0px 10px 0px 0px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); background-attachment: initial; background-color: inherit; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0% 0%; background-repeat: no-repeat;">view plain</a><span data-mod="popu_168"> <a target=_blank href="http://blog.csdn.net/testcs_dn/article/details/19758163#" target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  class="CopyToClipboard" title="copy" style="color: rgb(160, 160, 160); text-decoration: none; border: none; padding: 1px; margin: 0px 10px 0px 0px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); background-attachment: initial; background-color: inherit; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0% 0%; background-repeat: no-repeat;">copy</a></span><div style="position: absolute; left: 600px; top: 2815px; width: 18px; height: 18px; z-index: 99;"></div><span data-mod="popu_169"> </span><span data-mod="popu_167"><a target=_blank href="https://code.csdn.net/snippets/200692" target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" title="在CODE上檢視代碼片" style="color: rgb(160, 160, 160); text-decoration: none; border: none; padding: 1px; margin: 0px 10px 0px 0px; font-size: 9px; display: inline-block; width: 16px; height: 16px; background-image: none; background-attachment: initial; background-color: inherit; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0% 0%; background-repeat: no-repeat;"><img src="https://code.csdn.net/assets/CODE_ico.png" width="12" height="12" alt="在CODE上檢視代碼片" style="border: none; max-width: 100%; position: relative; top: 1px; left: 2px;" /></a></span><span data-mod="popu_170"><a target=_blank href="https://code.csdn.net/snippets/200692/fork" target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" title="派生到我的代碼片" style="color: rgb(160, 160, 160); text-decoration: none; border: none; padding: 1px; margin: 0px 10px 0px 0px; font-size: 9px; display: inline-block; width: 16px; height: 16px; background-image: none; background-attachment: initial; background-color: inherit; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0% 0%; background-repeat: no-repeat;"><img src="https://code.csdn.net/assets/ico_fork.svg" width="12" height="12" alt="派生到我的代碼片" style="border: none; max-width: 100%; position: relative; top: 2px; left: 2px;" /></a></span></div></div><ol start="1" style="padding: 0px; border: none; list-style-position: initial; list-style-image: initial; color: rgb(92, 92, 92); margin: 0px 0px 1px 45px !important; background-color: rgb(255, 255, 255);"><li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">workgroup = WORKGROUP  </span></span></li><li style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">server string = Samba Server Version %v  </span></li><li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">netbios name = CentOS  </span></li><li style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">create mask = 0777  </span></li><li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">directory mask = 0777  </span></li></ol></div><div class="dp-highlighter bg_plain" style="font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; width: 700.90625px; overflow: auto; padding-top: 1px; margin: 18px 0px !important; background-color: rgb(231, 229, 220);"><div class="bar" style="padding-left: 45px;"><div class="tools" style="padding: 3px 8px 10px 10px; font-stretch: normal; font-size: 9px; line-height: normal; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; border-left-width: 3px; border-left-style: solid; border-left-color: rgb(108, 226, 108); background-color: rgb(248, 248, 248);"><strong>[plain]</strong> <a target=_blank href="http://blog.csdn.net/testcs_dn/article/details/19758163#" target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  class="ViewSource" title="view plain" style="color: rgb(160, 160, 160); text-decoration: none; border: none; padding: 1px; margin: 0px 10px 0px 0px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); background-attachment: initial; background-color: inherit; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0% 0%; background-repeat: no-repeat;">view plain</a><span data-mod="popu_168"> <a target=_blank href="http://blog.csdn.net/testcs_dn/article/details/19758163#" target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  class="CopyToClipboard" title="copy" style="color: rgb(160, 160, 160); text-decoration: none; border: none; padding: 1px; margin: 0px 10px 0px 0px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); background-attachment: initial; background-color: inherit; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0% 0%; background-repeat: no-repeat;">copy</a></span><div style="position: absolute; left: 600px; top: 2956px; width: 18px; height: 18px; z-index: 99;"></div><span data-mod="popu_169"> </span><span data-mod="popu_167"><a target=_blank href="https://code.csdn.net/snippets/200692" target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" title="在CODE上檢視代碼片" style="color: rgb(160, 160, 160); text-decoration: none; border: none; padding: 1px; margin: 0px 10px 0px 0px; font-size: 9px; display: inline-block; width: 16px; height: 16px; background-image: none; background-attachment: initial; background-color: inherit; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0% 0%; background-repeat: no-repeat;"><img src="https://code.csdn.net/assets/CODE_ico.png" width="12" height="12" alt="在CODE上檢視代碼片" style="border: none; max-width: 100%; position: relative; top: 1px; left: 2px;" /></a></span><span data-mod="popu_170"><a target=_blank href="https://code.csdn.net/snippets/200692/fork" target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" title="派生到我的代碼片" style="color: rgb(160, 160, 160); text-decoration: none; border: none; padding: 1px; margin: 0px 10px 0px 0px; font-size: 9px; display: inline-block; width: 16px; height: 16px; background-image: none; background-attachment: initial; background-color: inherit; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0% 0%; background-repeat: no-repeat;"><img src="https://code.csdn.net/assets/ico_fork.svg" width="12" height="12" alt="派生到我的代碼片" style="border: none; max-width: 100%; position: relative; top: 2px; left: 2px;" /></a></span></div></div><ol start="1" style="padding: 0px; border: none; list-style-position: initial; list-style-image: initial; color: rgb(92, 92, 92); margin: 0px 0px 1px 45px !important; background-color: rgb(255, 255, 255);"><li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">security = user  </span></span></li><li style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">passdb backend = tdbsam  </span></li></ol></div>要在“passdb backend = tdbsam”注釋掉。
      
剛接觸Linux,原來配置檔案中的分号也是注釋符。      
<div class="dp-highlighter bg_plain" style="font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; width: 700.90625px; overflow: auto; padding-top: 1px; margin: 18px 0px !important; background-color: rgb(231, 229, 220);"><div class="bar" style="padding-left: 45px;"><div class="tools" style="padding: 3px 8px 10px 10px; font-stretch: normal; font-size: 9px; line-height: normal; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; border-left-width: 3px; border-left-style: solid; border-left-color: rgb(108, 226, 108); background-color: rgb(248, 248, 248);"><strong>[plain]</strong> <a target=_blank href="http://blog.csdn.net/testcs_dn/article/details/19758163#" target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  class="ViewSource" title="view plain" style="color: rgb(160, 160, 160); text-decoration: none; border: none; padding: 1px; margin: 0px 10px 0px 0px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); background-attachment: initial; background-color: inherit; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0% 0%; background-repeat: no-repeat;">view plain</a><span data-mod="popu_168"> <a target=_blank href="http://blog.csdn.net/testcs_dn/article/details/19758163#" target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  class="CopyToClipboard" title="copy" style="color: rgb(160, 160, 160); text-decoration: none; border: none; padding: 1px; margin: 0px 10px 0px 0px; font-size: 9px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); background-attachment: initial; background-color: inherit; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0% 0%; background-repeat: no-repeat;">copy</a></span><div style="position: absolute; left: 600px; top: 3119px; width: 18px; height: 18px; z-index: 99;"></div><span data-mod="popu_169"> </span><span data-mod="popu_167"><a target=_blank href="https://code.csdn.net/snippets/200692" target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" title="在CODE上檢視代碼片" style="color: rgb(160, 160, 160); text-decoration: none; border: none; padding: 1px; margin: 0px 10px 0px 0px; font-size: 9px; display: inline-block; width: 16px; height: 16px; background-image: none; background-attachment: initial; background-color: inherit; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0% 0%; background-repeat: no-repeat;"><img src="https://code.csdn.net/assets/CODE_ico.png" width="12" height="12" alt="在CODE上檢視代碼片" style="border: none; max-width: 100%; position: relative; top: 1px; left: 2px;" /></a></span><span data-mod="popu_170"><a target=_blank href="https://code.csdn.net/snippets/200692/fork" target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" rel="external nofollow"  target="_blank" title="派生到我的代碼片" style="color: rgb(160, 160, 160); text-decoration: none; border: none; padding: 1px; margin: 0px 10px 0px 0px; font-size: 9px; display: inline-block; width: 16px; height: 16px; background-image: none; background-attachment: initial; background-color: inherit; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0% 0%; background-repeat: no-repeat;"><img src="https://code.csdn.net/assets/ico_fork.svg" width="12" height="12" alt="派生到我的代碼片" style="border: none; max-width: 100%; position: relative; top: 2px; left: 2px;" /></a></span></div></div><ol start="1" style="padding: 0px; border: none; list-style-position: initial; list-style-image: initial; color: rgb(92, 92, 92); margin: 0px 0px 1px 45px !important; background-color: rgb(255, 255, 255);"><li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">[public]  </span></span></li><li style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">        comment = public file  </span></li><li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">        path = /home/dev  </span></li><li style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">        valid [email protected]  </span></li><li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">        writable=yes  </span></li><li style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">        browseable=yes  </span></li><li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">        public = yes  </span></li><li style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">        admin users = root  </span></li><li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">        create mask = 0664  </span></li><li style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">        direcotry mask = 0775  </span></li></ol></div><pre id="answer-content-1057139146" class="answer-text mb-10" name="code" style="white-space: pre-wrap; word-wrap: break-word; margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: arial, 'courier new', courier, 宋體, monospace; background-color: rgb(255, 255, 255);">重新開機smb服務
service smb restart
添加samba使用者,将root使用者增加為samba使用者
smbpasswd -a root
會提示輸入兩次密碼,這個密碼就是通路samba的密碼      

六、在Windows下映射網絡驅動器

<pre id="answer-content-1057139146" class="answer-text mb-10" name="code" style="white-space: pre-wrap; word-wrap: break-word; margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: arial, 'courier new', courier, 宋體, monospace; background-color: rgb(255, 255, 255);">先看看能不能通路:      
在windows系統中通過IP位址或剛才定義的網絡計算機名通路就可以
在位址欄輸入
\\192.168.x.x
或
\\CentOSServer      

如果共享檔案夾可以通路,打開Windows資料總管,添加映射就可以了。

<img src="https://img-blog.csdn.net/20140223152508187?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdGVzdGNzX2Ru/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" style="border: none; max-width: 100%;" />
<h3 style="margin: 0px; padding: 0px;"><a target=_blank name="t6" style="color: rgb(51, 102, 153);"></a>七、常見問題</h3>      
<span style="white-space: pre;">	</span>1、無法通路遠端主機      
<span style="white-space: pre;"></span><pre id="answer-content-1057139146" class="answer-text mb-10" name="code" style="white-space: pre-wrap; word-wrap: break-word; margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: arial, 'courier new', courier, 宋體, monospace; background-color: rgb(255, 255, 255);"><span style="white-space: pre;">		</span>先停止防火牆看看
<span style="white-space: pre;">		</span>service iptables stop      
<span style="white-space: pre; background-color: rgb(255, 255, 255);">	</span><span style="background-color: rgb(255, 255, 255);">2、<span style="color: rgb(99, 64, 27); font-family: 微軟雅黑, 黑體; font-size: 18px; line-height: 20px;">共享目錄無法通路</span></span>      
<span style="white-space: pre;"><span style="background-color: rgb(255, 255, 255);">	<span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> 1)關閉防火牆: #sevice iptables stop</span><br style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;" /><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> 2)修改 </span><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;">/etc/samba/smb.conf,具體配置網上有,我的如下:</span><br style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;" /><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;">  </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><br style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;" /><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> security = share </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> ---- 這個要用上,share表示安全最低級别,其次是user,最高是server</span><br style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;" /><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> [共享目錄名]</span><br style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;" /><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> path = /home/使用者名/共享目錄名</span><br style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;" /><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> ;read only = no </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> -----這個需要在前面用分号注釋掉</span><br style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;" /><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> writeable = yes</span><br style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;" /><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> browseable = yes</span><br style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;" /><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> public = yes</span><br style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;" /><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;">guest ok = yes</span></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></span></span>      
<span style="white-space: pre;"><span style="background-color: rgb(255, 255, 255);"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> 3)SELinux作怪</span><br style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;" /><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> 修改/etc/sysconfig/selinux</span><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> 把enforcing改成disabled;然後指令行setenforce 0</span><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;">;</span><br style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;" /><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> 或者用Rainsome兄說的 使用selinux強制政策:chcon -R -t samba_share_t /home/suyang/"Fedora Samba" </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;">  </span><br style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;" /><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> </span><wbr style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"><span style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;"> 4)修改目錄權限 #chmod 777 /home/wind ; #chmod 777 /home/wind/smbShare; 特别是前面一個做為上層目錄權限也需要修改!!!</span><br style="color: rgb(70, 70, 70); font-family: simsun; line-height: 21px;" /></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></span></span><p style="margin-top: 0px; margin-bottom: 5px; padding-top: 0px; padding-bottom: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; line-height: 21px; color: rgb(70, 70, 70); font-family: simsun;"><span style="background-color: rgb(255, 255, 255);"> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> 5)重新開機samba服務 #service smb restart 或者 /etc/rc.d/init.d/smb restart</wbr></wbr></wbr></wbr></wbr></wbr></wbr></span></p><p style="margin-top: 0px; margin-bottom: 5px; padding-top: 0px; padding-bottom: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; line-height: 21px; color: rgb(70, 70, 70); font-family: simsun;"><span style="background-color: rgb(255, 255, 255);"><span style="white-space: pre;">	</span> 當然你要在linux與windows之間互相能ping 通。</span></p>      

繼續閱讀