Portál AbcLinuxu, 7. května 2025 05:36
[global] workgroup = SKUPINA netbios name = MUJSERVER [sharetmp] path = /tmp public = yes read only = yes
# http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html [global] netbios name = storage workgroup = FIRMA #realm = FIRMA.LOCAL server string = %h server (Samba %v) #idmap uid = 500-10000000 #idmap gid = 500-10000000 #winbind separator = + #winbind enum users = yes #winbind enum groups = yes #winbind use default domain = Yes #client use spnego = yes dos charset = 852 unix charset = utf8 wins support = no ; wins server = 192.168.1.1 os level = 20 domain master = no domain logons = no local master = no preferred master = no dns proxy = no socket options = IPTOS_LOWDELAY TCP_NODELAY name resolve order = host #lmhost wins bcast log level = 2 log file = /var/log/samba/log.%m max log size = 1000 ; syslog only = no syslog = 0 hosts deny = ALL hosts allow = 192.168. 10.0.0. localhost ; localhost hosts deny = IP ; panic action = /usr/share/samba/panic-action %d security = user encrypt passwords = true password server = serverall # unix password sync = yes # username map = /etc/samba/smbusers smb passwd file = /etc/samba/smbpasswd null passwords = yes # passdb backend = tdbsam guest passdb backend = smbpasswd # obey pam restrictions = yes guest account = nobody map to guest = bad password # guest ok = yes invalid users = root passwd program = /usr/bin/passwd %u ; passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n . ; pam password change = no ; share modes = yes max connections = 50 create mask = 0644 directory mask = 0755 # level2 oplocks = True # read raw = no # write cache size = 262144 # mel by se zplepsit vykon : # use sendfile = yes # use mmap = no # getpeername failed. Error was Transport endpoint is not connected (dalsi moznost je nepouzivat wins) smb ports = 445 139 # usershare allow guests = no ########## Printing ########## load printers = no printing = printcap name = /etc/printcap ; printing = bsd ; printing = cups ; printcap name = cups ; printer admin = @ntadmin ; preserve case = yes ; short preserve case = yes ; include = /home/samba/etc/smb.conf.%m ; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' & ; idmap uid = 10000-20000 ; idmap gid = 10000-20000 ; template shell = /bin/bash #======================= Share Definitions ======================= [storage1] comment = Internal Storage RAID1 path = /mnt/storage1 writable = yes browseable = yes public = no valid users = admin administrator # valid users = ucetni franta pepa # valid users = @"FIRMA\ucetnigroup" @"FIRMA\Administrators" directory mask = 2777 create mask = 2666 [MIC] comment = Instalation Client path = /mnt/storage1/install writable = no browseable = yes public = yes guest ok = yes only guest = yes # valid users = admin administrator # valid users = @"FIRMA\ucetnigroup" @"FIRMA\Administrators" # directory mask = 2777 # create mask = 2666 create mask = 0777 directory mask = 0777 force user = nobody force group = nogroup nt acl support = yes [ZAPIS] comment = Zapis on storage2 path = /mnt/storage2/zapis writable = yes browseable = yes public = yes guest ok = yes only guest = yes # valid users = admin administrator # valid users = @"FIRMA\ucetnigroup" @"FIRMA\Administrators" # directory mask = 2777 # create mask = 2666 create mask = 0777 directory mask = 0777 force user = nobody force group = nogroup nt acl support = yes [franta] comment = Pokorny backup storage path = /mnt/storage1/Pokorny-Backup writable = yes browseable = yes public = no valid users = franta # valid users = ucetni franta pepa # valid users = @"FIRMA\ucetnigroup" @"FIRMA\Administrators" directory mask = 2777 create mask = 2666Založení uživatele probíhá :
# založíme uživatele v systému bez shell přístupu : useradd -M -N -s /bin/false franta # přidáme uživatele v sambě a zadáme uživateli heslo : smbpasswd -a franta
smbclient -L localhost Enter root's password: [Žádné heslo - pouze ENTER] Anonymous login successful Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.5.6] Sharename Type Comment --------- ---- ------- print$ Disk Printer Drivers data Disk Samba server's /mnt IPC$ IPC IPC Service (domov server) Anonymous login successfulNo, a pak se zkuste přihlásit již s uživatelským jménem (již i s heslem):
smbclient -U user1 //localhost/dataA pro toho uživatele se kterým se přihlašujete nezapomeňte předtím na smbpasswd, jak píše kolega výše.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.