Linux實踐工程師學習筆記九

來源:互聯網
上載者:User

samba的安全層級

[global]

       security = <level>

1.share

       windows使用者不需要認證就能訪問共用列表

2.user

       windows客戶機需輸入使用者才能訪問共用名稱列表,伺服器上需建立使用者帳號

3.server

       用戶端需輸入合法使用者幫能訪問,但認證過程在另一伺服器進行,使用者帳號儲存在認證的那台伺服器上。

share,user只對windows客戶機有效,linux客戶機在user層級不用密碼也能訪問共用名稱列表。security只保護主機的共用名稱列表,具體到目錄的訪問則由目錄的規則決定。

 

#hostname      查看主機名稱

#nmblookup    my-server       查詢主機IP(與samba netbios name有關)

#man smb.conf      查看相關協助

vi搜尋技巧:

       /%m              先輸入”/”再輸入要尋找的字串

       /redhat    如尋找”redhat”字串

       shift+G   跳到檔案尾

 

預設伺服器名與機器DNS的第一部分相同

如Fedora.cyrich.com則這台samba伺服器的名稱就是Fedora

 

存取控制

一、全域控制

[global]

       hosts deny = ALL

       hosts allow = 192.168.0.

二、局部存取控制

[docs]

       hosts deny = 192.168.0.

       hosts allow = 192.168.0.1

[redhat]

       hosts allow = 192.168.0.

       host deny = 192.168.0.1       (失效)

允許優先!!

hosts 後面的格式文法,可以通過man 5 host.access查看協助

1.點開頭 .edu.cn

2.點結尾 192.168.0.

3.192.168.0.0/255.255.255.0

  192.168.0.0/24

4.ALL  LOCAL UNKNOWN       DNS不能解析的

5./開頭   指定一個檔案

6.hosts allow = 192.168.0.0 EXCEPT  192.168.0.1

允許192.168.0網段主機訪問,但192.168.0.1除外

 

技巧:

#tail /etc/samba/smb.conf

顯示檔案最後的十行

vi中shift+D刪除一行

聯繫我們

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