SMB命令列配置

來源:互聯網
上載者:User

Samba 使用 /etc/samba/smb.conf 作為它的設定檔。如果你改變了這個設定檔,這個改變直到你使用
service smb restart 命令重啟 Samba 守護進程後才會生效。

要指定 Windows 工作群組和對它的簡短描述,編輯 smb.conf
檔案中的以下幾行:

workgroup = WORKGROUPNAME
server string = BRIEF COMMENT ABOUT SERVER

WORKGROUPNAME 換成你的機器所屬的
Windows 工作群組名。BRIEF COMMENT ABOUT SERVER
是可選的,它被用作關於 Samba 系統的 Windows 注釋。

要在你的 Linux 系統上建立 Samba 共用目錄,在 smb.conf
檔案中添加以下幾行(根據你和你的系統需要修改了該檔案之後):

[sharename]
comment = Insert a comment here
path = /home/share/
valid users = tfox carole
public = no
writable = yes
printable = no
create mask = 0765

上面的例子允許使用者 tfox 和 carole 從 Samba 客戶中讀寫
Samba 伺服器上的目錄 /home/share。

關鍵:關閉防火牆

==============================================================================================

第二種配置方式:

SAMBA伺服器的架設
  環境:linux企業4一台,windows xp 一台。企業4為SAMBA伺服器,xp為用戶端。
  實現目標:為了安全起見,使用者通過自己的使用者名稱可以訪問自己的宿主目錄,允許寫入。
            root組的使用者可以訪問/etc/yujin檔案。但只允許唯讀。
 一、SAMBA伺服器的配置  (設定ip地址10.0.0.253)
   1、安裝  samba -common      samba      samba -client (預設情況下已經安裝)
   2、建立使用者並設定samba密碼:useradd linux    passwd linux    smbpasswd -a linux 
   3、在/etc下建立目錄yujin ,並建立檔案 a b c  
   4、修改主設定檔 /etc/samba/smb.conf
      vi /etc/samba/smb.conf  添加:
      [root]
            comment=root
            path=/etc/yujin
            read only=yes
            read list=linux,@root
            deadtime=20  (20分鐘不對伺服器操作就中斷串連)
            client code page=936 (用戶端支援中文)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.