linux lamba資源共用

來源:互聯網
上載者:User

 linux資源共用samba配置server
samba.i386
samba-common.i386
[root@mail Server]# yum install samba-3.0.33-3.28.el5.i386.rpm
[root@mail ~]# vi /etc/samba/smb.conf
74         workgroup = MYGROUP     /////工作群組
     75         server string = Samba Server Version %v
     76
     77 ;       netbios name = MYSERVER
     78
     79 ;       interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24    ////修改連接埠地址
     80 ;       hosts allow = 127. 192.168.12. 192.168.13.     /////允許哪個網段訪問
     89 ;       log file = /var/log/samba/%m.log     //////記錄檔存放位置  只有被訪問時會產生一個ip.log的記錄檔
 
    101         security = user       /////許可權     1.share 許可權  匿名可以訪問  2.user 許可權  身分識別驗證   samba帳號庫(在本地)  3.server  許可權  身分識別驗證  samba帳號庫(在其他伺服器) 4.ads  (domain) 身分識別驗證   samba帳號庫(dc)
    102         passdb backend = tdbsam
 
[root@mail ~]# mkdir /tmp/pub
[root@mail ~]# mkdir  /tmp/user2
[root@mail ~]# mkdir  /tmp/user3
[root@mail tmp]# chown user2:user2 user2   
[root@mail tmp]# chown user3:user3 user3
263 [pub]     ///////共用名稱
    264         comment = All Printers
    265         path = /tmp/pub        //////目錄位置
    266         browseable = yes        ///////可讀
    267         guest ok = yes          ///////任何人可以訪問
    268         writable = no           ///////不可寫
    269 [sauser2]
    270         comment = All user2
    271         path = /tmp/user2
    272         browseable = yes
    273         guest ok = yes
    274         valid users = user2         //////只有使用者user2可以訪問此目錄
    275         writable = yes
    276 [sauser3]
    277         comment = All user3
    278         path = /tmp/user3
    279         browseable = yes
    280         guest ok = yes
    281         valid users = user3
    282         writable = yes
[root@mail ~]# testparm      //////查看測試結果是否有錯
 
[root@mail ~]# smbpasswd -a user2
New SMB password:
Retype new SMB password:
Added user user2.
[root@mail ~]# smbpasswd -a user3   ////密碼可以和本機使用者密碼不同
New SMB password:
Retype new SMB password:
Added user user3.
[root@mail ~]# service smb restart
開啟之後user2和user3 只能訪問自己可以訪問的目錄不能訪問其他目錄
作者“緣夢星”

聯繫我們

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