CentOS安裝配置Samba

來源:互聯網
上載者:User

標籤:

介紹

Samba可以讓我們在windows中訪問linux系統中的檔案,如果用來調試linux虛擬機器中的代碼會非常的方便

1、安裝

yum -y updateyum install samba samba-client samba-swat -y

 2、查看安裝情況

[[email protected] samba]# rpm -qa|grep samba samba-swat-3.6.23-20.el6.i686samba-common-3.6.23-20.el6.i686samba-winbind-clients-3.6.23-20.el6.i686samba-3.6.23-20.el6.i686samba-winbind-3.6.23-20.el6.i686samba-client-3.6.23-20.el6.i686

 3、對路由表做如下操作

iptables -I INPUT 4 -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT  iptables -I INPUT 5 -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT  iptables -I INPUT 6 -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT  service iptables save

 4、建立使用者

useradd smbuser  groupadd smbgrp  usermod -a -G smbgrp smbuser  smbpasswd -a smbuser  

 5、組建目錄

cd /home/samba/  mkdir test  chown -R smbuser:smbgrp test/  chmod -R 0770 test/ 

 6、組建組態檔案

[global]workgroup = MYGROUPserver string = Samba Server Version %vlog file = /var/log/samba/log.%mmax log size = 50security = sharepassdb backend = tdbsamload printers = yescups options = raw[homes]         comment = Home Directoriesbrowseable = no writable = yes  [printers]      comment = All Printerspath = /var/spool/sambabrowseable = no guest ok = no   writable = no   printable = yes [share]path = /tmpwriteable = yesbrowseable = yescreate mask =  0664directory mask = 0775guest ok = yespublic = yes[test]        comment = Public Stuffpath = /home/samba/public = yes    writable = yes  printable = no write list = +staff   valid users = smb

 7、重啟

chkconfig smb on  chkconfig nmb on  service smb restart && service nmb restart

如果出現沒有許可權的問題,請再次確認以下幾個重點

1.關閉防火牆: service iptables stop2.設定SELinux的寬鬆模式:setenforce 03.設定你需要共用的檔案夾的屬性為777,chmod 777 /share4.重啟了smb和nmb服務。

 最近在配置samba,windows串連的時候出現如下問題:samba不允許一個使用者使用一個以上使用者名稱與一個伺服器或共用資源的多重串連

net use * /del /y

這個不是samba的限制,是Windows的限制,如果要用public=yes的話,上面的方法都不能有效解決

原因:在開啟存在 public=yes的samba伺服器時,如果首先點擊了有public=yes的共用資源的時候,widows會用預設的使用者名稱去串連伺服器,一般就 是windows的登入名稱(可以在伺服器端查看到的),這時候,再去點擊沒有public=yes的共用資源,由於使用了user層級,伺服器就會要求驗證,這時,之前的預設登入已經存在,就出現了樓主的故障了。即使登出串連後如果沒有採用正確的順序訪問共用資源,還是會陷入這個泥潭中。因此,最好辦法就 是不用public=yes,給公用帳號建立一個共用的賬戶並公示出來。這樣處理,其實許可權更清晰一些

參考:

http://www.linuxsir.org/main/?q=node/158
http://blogold.chinaunix.net/u/19637/showart_491257.html

CentOS安裝配置Samba

相關文章

聯繫我們

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

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

A Free Trial That Lets You Build Big!

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

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

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