CentOS虛擬機器如何設定共享資料夾,並在Windows下對映網路驅動器?

mybwu_com發表於2014-02-23

一、為什麼要這麼做?

最近在做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伺服器

可以通過光碟或網路安裝 samba

1、通過網路安裝

本人就是用的網路安裝,雖然有點慢,但是比較簡單方便。

命令:sudo yum install samba

就一條命令就OK了。

2、通過光碟安裝

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

先把iso映象掛載上,一般情況下光碟機的裝置標識為/dev/hdc

[root@sycflash ~]# mkdir /mnt/temp

[root@sycflash ~]#mount /dev/hdc /mnt/temp

[root@sycflash ~]#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

...

[root@sycflash ~]#rpm -ivh/mnt/temp/Server/samba-3.0.33-3.28-1.el5.i386.rpm

error: Failed dependencies:
perl(Convert::ASN1) is needed bysamba-3.0.33-3.28-1.el5.i386

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

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

/mnt/temp/Server/

[root@sycflash ~]#rpm -ivh/mnt/temp/Server/samba-3.0.33-3.28-1.el5.i386.rpm

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

[root@sycflash ~]#service smb status

smbd is stopped

nmbd is stopped

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

五、配置 Samba

	先在/home目錄mkdir 目錄 samba
	修改 samba 許可權 
	chmod 0777 /home/samba
	如果需要共享的目錄已經存在 了,那麼只修改目錄的訪問許可權就可以了。

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

	修改幾次地方:
	找到以下幾行把註釋去掉
	setsebool -P samba_domain_controller on
	setsebool -P samba_enable_home_dirs on
	setsebool -P samba_export_all_rw on

	修改  workgroup = MYGROUP 為 MYGROUP  工作組為你windows 的工作組,一般為WORKGROUP
	workgroup = WORKGROUP
	server string = Samba Server Version %v
	netbios name = CentOSServer #網路計算機名,可以通過它訪問共享檔案如:\\CentOSServer
	跟著新增這兩行
	create mask = 0777
	directory mask = 0777

	然後在檔案最後新增這幾行

	[public]
	comment = public file
	path = /home/samba #剛才mkdir的資料夾
	valid users = root
	writable = yes
	browseable = yes

	:wq命令儲存退出
	下面給出我的配置檔案內容,只貼出關鍵部分:
        workgroup = WORKGROUP
        server string = Samba Server Version %v
        netbios name = CentOS
        create mask = 0777
        directory mask = 0777
        security = user
#       passdb backend = tdbsam
要在“passdb backend = tdbsam”註釋掉。
剛接觸Linux,原來配置檔案中的分號也是註釋符。
[public]
        comment = public file
        path = /home/dev
        valid users=@root
        writable=yes
        browseable=yes
        public = yes
        admin users = root
        create mask = 0664
        direcotry mask = 0775
重啟smb服務
service smb restart
新增samba使用者,將root使用者增加為samba使用者
smbpasswd -a root
會提示輸入兩次密碼,這個密碼就是訪問samba的密碼

六、在Windows下對映網路驅動器

先看看能不能訪問:
在windows系統中通過IP地址或剛才定義的網路計算機名訪問就可以
在位址列輸入
\\192.168.x.x
或
\\CentOSServer
如果共享資料夾可以訪問,開啟Windows資源管理器,新增對映就可以了。

七、常見問題

	1、無法訪問遠端主機
		先停止防火牆看看
		service iptables stop
	2、共享目錄無法訪問
	<wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">1)關閉防火牆: #sevice iptables stop</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">2)修改</span><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">/etc/samba/smb.conf,具體配置網上有,我的如下:</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">security = share</span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">---- 這個要用上,share表示安全最低階別,其次是user,最高是server</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">[共享目錄名]</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">path = /home/使用者名稱/共享目錄名</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">;read only = no</span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">-----這個需要在前面用分號註釋掉</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">writeable = yes</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">browseable = yes</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">public = yes</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; 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>
<wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">3)SELinux作怪</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">修改/etc/sysconfig/selinux</span><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">把enforcing改成disabled;然後命令列setenforce 0</span><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">;</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; 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; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"></span><wbr style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px"><span style="color:rgb(70,70,70); font-family:simsun; font-size:14px; line-height:21px">4)修改目錄許可權 #chmod 777 /home/wind ; #chmod 777 /home/wind/smbShare; 特別是前面一個做為上層目錄許可權也需要修改!!!</span><br style="color:rgb(70,70,70); font-family:simsun; font-size:14px; 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>

<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>

當然你要在linux與windows之間互相能ping 通。


相關文章