sambaプロファイルの詳細


samba serverのコンフィギュレーションファイルは/etc/samba/下のsmb.comで一つの端末に入力します。gedit/etc/samba/smb.com fもviで編集できます。ファイルが長すぎて、個人的には役に立たないと思っていたものを削除しました。主にいくつかのコメントです。メインの単語の意味を説明します。このファイルは構成しました。あなたのマシンとは同じではないかもしれません。
======================= Global Settings =====================================
[global] //  samba      
workgroup = hackase //      
server string = angel server //       

; hosts allow = 192.168.1. 192.168.2. 127. //         IP  ,     
   ,           ";"
printcap name = /etc/printcap //       
load printers = yes //       

# bsd, sysv, plp, lprng, aix, hpux, qnx, cups
printing = cups //      .             .

; guest account = pcguest //pcguest    .       ";"    
pcguest      ,   /etc/passwd    .

log file = /var/log/samba/%m.log //                  .

max log size = 0 //       ,"0"     

//   smb.conf             

security = SHARE //         .share、user、server、domain

; password server =        .
; password level = 8 //    
; username level = 8

encrypt passwords = yes //      ,        

smb passwd file = /etc/samba/smbpasswd //         samba server.
             .        ,  samba server    win
server     

; ssl CA certFile = /usr/share/ssl/certs/ca-bundle.crt

unix password sync = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *New*password* %n
*Retype*new*password* %n
*passwd:*all*authentication*tokens*updated*successfully* pam password change = yes ; username map = /etc/samba/smbusers // windows samba ; include = /etc/samba/smb.conf.%m obey pam restrictions = yes ; interfaces = 192.168.12.2/24 192.168.13.2/24 ; remote announce = 192.168.1.255 192.168.2.44 ; local master = no ; os level = 33 ; domain master = yes ; preferred master = yes ; domain logons = yes ; logon script = %m.bat ; logon script = %U.bat ; logon path = \\%L\Profiles\%U ; wins support = yes //wins server ; wins server = w.x.y.z ; wins proxy = yes //wins dns proxy = no //dns ; preserve case = no ; short preserve case = no ; default case = lower ; case sensitive = no #============================ Share Definitions ============================== [homes] // comment = Home Directories // ( ) browseable = no// writeable = yes// valid users = %S create mode = 0664 directory mode = 0775 ; [netlogon] // ; comment = Network Logon Service ; path = /usr/local/samba/lib/netlogon ; guest ok = yes ; writable = no ; share modes = no ;[Profiles] ; path = /usr/local/samba/profiles ; browseable = no ; guest ok = yes [printers] // comment = All Printers path = /var/spool/samba browseable = no printable = yes ;[tmp] // ; comment = Temporary file space ; path = /tmp // , ";" OK ; read only = no // ; public = yes ;[public] // ; comment = Public Stuff ; path = /home/samba ; public = yes ; writable = yes ; printable = no ; write list = @staff [my work] // comment = is me work path = /root/my work valid users angel public = yes writeable = yes
 
  smb.conf       .     samba server           .
1、share   

            ,       .     smb.conf          .

workgroup = hackase
server string = angel server
hosts allow = 192.168.1. //  192.168.1 IP      
printcap name = /etc/printcap
load printers = yes //     
printing = cups //    linux   
guest account = angel
log file = /var/log/samba/%m.log
max log size = 20
security = share
===================================================================
           ,             .[tmp]     ";"  .
      .        /etc/samba/smb restart //

service smb restart   

 testparm             :
===================================================================
[root@localhost root]# testparm //   [printers]          .
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[tmp]"
Processing section "[my]"
Loaded services file OK. //    ,          .
Press enter to see a dump of your service definitions
==================================================================
 smbclient          
===================================================================
[root@localhost etc]# smbclient -L localhost //    localhost
Password:
Domain=[HACKBASE] OS=[Unix] Server=[Samba 2.2.7a]

Sharename Type Comment
--------- ---- -------
tmp Disk Temporary file space
my Disk is me
IPC$ IPC IPC Service (angel server)
ADMIN$ Disk IPC Service (angel server)
root Printer Home Directories

Server Comment
--------- -------

Workgroup Master
--------- -------
=======================================================================
2、user   

user share         ,    ,   share          .
   security = share   :security = user.       :
guest account = angel //         ,           !
encrypt passwords=yes
smb passwd file=/etc/samba/smbpasswd
(1)      .

#cat/etc/passwd | mksmbpasswd.sh>/etc/samba/smbpasswd

          "/etc/samba/smbpasswd"       
    "smb passwd file=/etc/samba/smbpasswd"
(2)          etc/passwd   ,     smbpasswd  
          samba server  .    :smbpasswd angel

(3)  samba server  

user   OK ,    testparm and smbclient   .windows   
      angel and passwd.               

   .

3、server    
server  user       ,   user         OK .

(1)security = user   :security = server

(2)  password server = ****** //     ,       windows     , 
      samba server   (     )

(3)  smb passwd file=/etc/samba/smbpasswd

(4)  samba server  ,    testparm and smbclient   .

  ,           windows    ******(password server = 
******   )       ,       samba server, 

    *****       ,                 samba server    ,
      ***** sambs server        .

4、domain    
domain     samba server            samba      ,
      samba server      .

  domain        ,    user       :

(1)    :NETBLOS = main //   NETBLOS ,  smb.conf      
password server = ** //      **       
(2)security = user   :security = domain
workgroup = ***** //*****         
(3)  smb passwd file=/etc/samba/smbpasswd
(4)  samba server  ,    testparm and smbclient   .
     ,    "    "    .          windows     ,
       ,  ~~~        ,       linux      
windows       !  .     ,               ,
            .  ,      :
[root@localhost root]# fdisk -l //   windows       .

Disk /dev/hdb: 61.4 GB, 61492838400 bytes
255 heads, 63 sectors/track, 7476 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 738 5927953+ 7 HPFS/NTFS
/dev/hdb2 739 7476 54122985 f Win95 Ext'd (LBA)
/dev/hdb5 739 1480 5960083+ 7 HPFS/NTFS
/dev/hdb6 1481 2383 7253316 b Win95 FAT32
/dev/hdb7 3651 6200 20482843+ b Win95 FAT32
/dev/hdb8 6201 7476 10249438+ b Win95 FAT32
/dev/hdb9 2384 2396 104391 83 Linux
/dev/hdb10 2397 3585 9550611 83 Linux
/dev/hdb11 3586 3650 522081 82 Linux swap

[root@localhost root]# mkdir /mnt/my 
// mnt     my   (        )
[root@localhost root]# mount -t auto /dev/hdb7 /mnt/my //     !
       windows    ,          ntfs   .
windows    linux       ,"explore2fs"   
http://download.enet.com.cn/html/030282000080601.html  



    :http://developer.51cto.com/art/200511/12714.htm