搭建 CentOS 6 伺服器(12) - Samba

來源:互聯網
上載者:User

標籤:

(1)安裝
Java代碼  
  1. # yum -y install samba  
  2.     Installed:  
  3.       samba.i686 0:3.6.9-169.el6_5  
  4. # pdbedit -a rensn  
  5.     new password:123456  
  6.     retype new password:123456  
  7.     ……  


(2)Home檔案夾
Java代碼  
  1. # mkdir /etc/skel/samba  
  2. # mkdir /home/rensn/samba  
  3. # chown rensn:rensn /home/rensn/samba  


(3)共用資料夾
Java代碼  
  1. # mkdir /home/samba  
  2. # chown nobody:nobody /home/samba  


(4)設定
Java代碼  
  1. # cp /etc/samba/smb.conf /etc/samba/smb.conf.bak  
  2. # vi /etc/samba/smb.conf  
  3.     [global]  
  4.        unix charset = UTF-8     # <= Linux編碼  
  5.        dos charset = CP932      # <= Windows編碼  
  6.        display charset = UTF-8  # <= Linux編碼  
  7.        smb ports = 139            # <= 連接埠  
  8.   
  9.        workgroup = FUGA         # <= Windows的Workgroup名  
  10.   
  11.        hosts allow = 127. 192.168.21.  # <= 只允許本地網路訪問  
  12.   
  13.        load printers = no     # <= 不允許共用印表機  
  14.        disable spoolss = yes    
  15.   
  16.        printing = bsd   
  17.     [homes]  
  18.        comment = Home Directories  
  19.        path = %H/samba     # <= home檔案夾路徑/home/<user>/samba  
  20.        browseable = no  
  21.        writable = yes  
  22.     [public]   
  23.        comment = Public Stuff  
  24.        path = /home/samba  
  25.        public = yes  
  26.        writable = yes  
  27.        only guest = yes  


(5)啟動服務
Java代碼  
  1. # /etc/rc.d/init.d/smb start  
  2. # /etc/rc.d/init.d/nmb start  


(6)確認
從Windows系統訪問後建立檔案後
Java代碼  
  1. # ll  /home/rensn/samba  


(7)SWAT

安裝
Java代碼  
  1. # yum -y install samba-swat  


設定
 
  1. # vi /etc/xinetd.d/swat  
  2.     service swat  
  3.     {  
  4.         port            = 901  
  5.         socket_type     = stream  
  6.         wait            = no  
  7.         only_from       = 127.0.0.1 192.168.21.0/24  
  8.         user            = root  
  9.         server          = /usr/sbin/swat  
  10.         log_on_failure  += USERID  
  11.         disable         = yes  
  12.     }  


確認
通過瀏覽器訪問:https://<youripaddress>:901/

搭建 CentOS 6 伺服器(12) - 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.