Fedora9安裝samba服務

來源:互聯網
上載者:User
Fedora9安裝samba服務
搗鼓了2、3天,總算是把samba服務搞定了,下面就總結下我安裝samba服務的過程。
至於samba的簡介這就不說了吧,網上一搜一大堆的,我們就直接從怎麼安裝samba說起:1.我是從安裝包裡安裝的samba軟體包

(1)首先,從虛擬機器的vm->Removable Devices->CD/DVD->Setting,在彈出的對話方塊右邊的中間位置選擇你的fedora9安裝包,再串連一下
(2)這時,在你的fedora9中的案頭會出現cdrom,雙擊開啟,進入Packages目錄
(3)把終端定位在這個目錄下,因為samba rpm包有依賴關係,所以依次安裝下面幾個安裝包:
# rpm -ivh perl-Convert-ASN1-0.21-3.fc9.noarch.rpm
# rpm -ivh samba-3.2.0-1.pre3.9.fc9.i386.rpm
# rpm -ivh samba-client-3.2.0-1.pre3.9.fc9.i386.rpm
# rpm -ivh samba-common-3.2.0-1.pre3.9.fc9.i386.rpm
# rpm -ivh samba-winbind-3.2.0-1.pre3.9.fc9.i386.rpm
2.如果正常安裝完成後,就啟動samba服務吧:

# service smb start
# service nmb start
3.這時最好是將以前的smb.conf備份一下:

# cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
4.然後就編輯smb.conf檔案吧,添加如下資訊:

 [global]          workgroup = WORKGROUP         server string = Samba Server Version %v         log file = /var/log/samba/%m.log         max log size = 50         security=share  //我比較懶,這裡就設的share,如果你勤快,也可以設成usr啦         dos charset=cp936         unix charset=cp936 [samba]         comment=samba         path=/mnt/samba         public=yes         writable=yes         write list=@
儲存退出,並從新啟動下samba:
# /etc/init.d/smb  restart
5.在fedora9我們只能看到共用,但是訪問的時候會出現拒絕訪問的情況,這是為什麼呢?因為selinux對samba共用做了限制,我們得解決這個限制吧,接著再用下面命令查看有哪些是off狀態的:

# getsebool -a | grep samba
6.哪個off就把哪個開啟,比如下面:

# setsebool -P samba_domain_controller on
# setsebool -P samba_share_fusefs on
7.此外,如果還不行的吧,就關了防火牆:

查看防火牆狀態:# /etc/init.d/iptables status
暫時關閉防火牆:# /etc/init.d/iptables stop        

好了,在windows下點擊:開始->運行->cmd->\\192.168.x.xxx(你的linuxip),開啟後就能看到你設的共用目錄了。

如果上面所有辦法都試了還不行,再試試下面的吧(保證管用^_^):[root@localhost mnt]# chkconfig smb on
[root@localhost mnt]# chkconfig --list smb
smb             0:off1:off2:on3:on4:on5:on6:off
[root@localhost mnt]# chkconfig --list nmb
nmb             0:off1:off2:off3:off4:off5:off6:off
[root@localhost mnt]# chkconfig nmb on
[root@localhost mnt]# chkconfig --list nmb
nmb             0:off1:off2:on3:on4:on5:on6:off
[root@localhost mnt]#  /etc/rc.d/init.d/smb start
Starting SMB services:                                     [  OK  ]
[root@localhost mnt]#  /etc/rc.d/init.d/nmb start
Starting NMB services:                                     [  OK  ]
[root@localhost mnt]# mkdir /mnt/samba
[root@localhost mnt]# chmod 777 /mnt/samba/

PS:還有哪不清楚的歡迎留言討論^_^!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.