====== Debian Fileserver with Samba ====== {{template>vorlagen:tutorialdetails|tutname=Debian Fileserver mit Samba|tutautor=[[en:psycore]]|tutversion=1.0|tutquelle=http://www.tim-bormann.de/anleitung-installation-samba-server-als-dateiserver-unter-debian-linux/}} ===== Install Samba ===== fserve ~:# apt-get install samba Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: openbsd-inetd inet-superserver smbldap-tools ldb-tools The following NEW packages will be installed samba 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. ... ... Importing account for root...ok ... Adding group `sambashare' (GID 110) ... Done. Starting Samba daemons: nmbd smbd. ===== Creating the groups ===== fserve :~# addgroup smball fserve :~# addgroup smbusers fserve :~# addgroup smbadmins ===== Create group folder ===== fserve :~# mkdir /home/groupsmball fserve :~# mkdir /home/groupsmbusers fserve :~# mkdir /home/groupsmbadmins fserve :~# chown root:smball /home/groupsmball/ fserve :~# chown root:smbusers /home/groupsmbusers/ fserve :~# chown root:smbadmins /home/groupsmbadmins/ fserve :~# chmod 770 /home/groupsmbusers/ fserve :~# chmod 770 /home/groupsmbadmins/ fserve :~# chmod 2770 /home/groupsmball/ ===== Samba configuration ===== ==== Save configuration ==== fserve ~:# cp /etc/samba/smb.conf /etc/samba/smb.conf_old Open smb.conf and delete content. ==== Configuration ==== [global] # Arbeitsgruppe workgroup = # Zugriff per "share" oder "user" # security = share security = user # nur notig bei security = user encrypt passwords = yes # Network Neighbourhood netbios name = #Genutze Adapter; bei einem eigentlich nicht notwendig ; interfaces = 192.168.1.2/24 ; bind interfaces only = yes # NT Beschreibung server string = Server Samba %v # Speeddoping socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 #IP-Zugriffsbeschraenkungen; das ";" entfernen um die IP-Listen zu aktivieren ; hosts allow = 127. 192.168.1.1 192.168.1.2 192.168.1.3 ; hosts deny = 0.0.0.0/0 ########## Homeverzeichnisse ######### [homes] comment = homes read only = no create mask = 0700 browseable = no #####Share-Verzeichnisse # Namen in eckigen Klammern sind frei waehlbar [sbmusers] comment = Freigabe smbusers path = /home/groupsmbusers read only = no # ; valid users: ; admin users: chef [smbadmins] comment = Freigabe smbadmins path = /home/groupsmbadmins read only = no [smball] comment = smball path = /home/groupsmball read only = no create mask = 770 directory mask = 770 Save file. ==== Test configuration ==== fserve ~:# testparm ==== Restart Samba ==== fserve ~:# /etc/init.d/samba restart Stopping Samba daemons: nmbd smbd. Starting Samba daemons: nmbd smbd ===== Create user ===== ==== normal user ==== fserve :~# useradd -g smbusers -G smball -m test fserve :~# chmod 700 /home/test fserve :~# smbpasswd -a test New SMB password: Retype new SMB password: Added user test. ==== Create admin user ==== fserve :~# useradd -g smbadmins -G smball,smbusers -m test fserve :~# chmod 700 /home/test fserve :~# smbpasswd -a test New SMB password: Retype new SMB password: Added user test.