Linux實踐工程師學習筆記七

來源:互聯網
上載者:User

linux訪問網路位置

1.掛載方法

       #mount –t smbfs //192.168.0.1/linux /mnt   

或   #mount.cifs //192.168.0.1/linux /mnt

2.#smbclient //192.168.0.1/linux –U redhat%123

 

存取控制

public = yes           允許所有人訪問

        = no             不允許匿名訪問

1.共用目錄設定有效使用者

[redhat]

       path = /var/redhat

       comment = redhat’s files

       valid users = <username> <@groupname>

2.建立samba使用者

       #useradd username        建立一個系統使用者

       #smbpasswd –a username     將使用者加入到samba中

3.使用者帳號映射

[global]

       username map = /etc/samba/smbusers

4.修改smbusers檔案,添加虛擬使用者名稱

       redhat = tom jack

5.需重啟smb服務讀取對應檔

 

HOME目錄

[global]

       comment = Home Directories

       validusers = %S            %S目錄屬主

       browseable = no           不允許瀏覽home目錄

       writable = yes               允許寫

       valid users = 有效使用者列表

       write list = 可寫使用者列表

       create mask = 0660              定義建立檔案的預設許可權

       directory mask = 0770 定義建立目錄的預設許可權

 

chown redhat /var/redhat 改變目錄屬主

ls –lh       顯示目錄裡各個檔案的詳細資料

ls –ld /usr/redhat    只顯示目錄本身的詳細資料

 

#testparm              測試組態預設檔案smb.conf的正確性

#testparm /etc/samba/smb.conf my-server 192.168.0.1

測試客戶機能訪問伺服器的哪些目錄

 

[redhat]

       path = /var/redhat

       comment = redhat’s files

       public = no

       valid users = <username> <@groupname>

       write list  = <username> <@groupname>

       create mask = 0660

       directory mask = 0770

注意:用戶端所有請求訪問身份在伺服器端都會映射成登入帳號的身份

相關文章

聯繫我們

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