Condivisione file samba con cestino di rete

Qui spiego come configurare samba, il programma di condivisione files per windows, per mantenere un cestino di rete.

Installate il software necessario:

sudo apt-get install samba cups cups-pdf cupsys cupsys-client cups-pt samba smbfs smbclient

Ora editate il file di configurazione /etc/samba/smb.conf

sudo vi /etc/samba/smb.conf

Cancellate tutto ed inserite questo:



#======================= Global Settings =======================

[global]

## Browsing/Identification ###

workgroup = workgroup
server string = %h
netbios name = server-pdc
wins support = yes
dns proxy = yes
os level = 64
time server = Yes
; remote announce = 192.168.1.255
; name resolve order = lmhosts host wins bcast
Dos charset = 850
Unix charset = ISO8859-1
min passwd length = 3
fstype = NTFS
;get quota command = /usr/local/sbin/query_quota

#### Networking ####

; hostname lookups = yes
; interfaces = 127.0.0.0/8 eth0
; host allow = 127.0.0.1 192.168.100.0/255.255.255.0
; hosts deny = ALL
; bind interfaces only = true

#### Debugging/Accounting ####

log file = /var/log/samba/log.%m
max log size = 1000
syslog only = yes
syslog = 0
panic action = /usr/share/samba/panic-action %d

####### Authentication #######

security = user
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
; guest account = nobody
invalid users = root
admin users = administrator

; unix password sync = no
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *password\supdated\ssuccessfully* .
passwd chat debug = yes
; pam password change = no

########## Domains ###########

; domain logons = yes
; logon path = \\%N\profiles\%U
; logon path = \\%N\%U\profile
; logon drive = H:
; logon home = \\%N\%U
; logon script = logon.cmd
; add user script = /usr/sbin/useradd -m %u
; delete user script = /usr/sbin/userdel -r %u
; add group script = /usr/sbin/groupadd %g
; delete group script = /usr/sbin/groupdel %g
; add user to group script = /usr/sbin/usermod -G %g %u
# Aggiunge automaticamente al sistema l'account di una nuova macchina.
; add machine script = /usr/sbin/useradd -d /dev/null -g lpadmin -s /bin/false -M %u

########## Ldap ##########

; ldap passwd sync = Yes
; passdb backend = ldapsam:ldap://127.0.0.1/
# passdb backend = ldapsam:"ldap://127.0.0.1/ ldap://slave.idealx.com"
# ldap filter = (&(objectclass=sambaSamAccount)(uid=%u))
# ldap admin dn = uid=samba,ou=People,dc=municipio,dc=org
; ldap suffix = dc=municipio,dc=org
; ldap machine suffix = ou=People
; ldap user suffix = ou=People
; ldap group suffix = ou=Groups
; ldap idmap suffix = ou=Idmap
; ldap admin dn = cn=Manager,dc=municipio,dc=org
; idmap backend = ldap://draco.municipio.org
# ldap ssl = start tls

########## Printing ##########

load printers = yes
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
printer admin = @ntadmin
show add printer wizard = yes

############ Misc ############

; include = /home/samba/etc/smb.conf.%m
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &
; domain master = auto
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash
; winbind enum groups = yes
; winbind enum users = yes

#======================= Share Definitions =======================

[homes]
comment = Home Directories
inherit acls = Yes
inherit owner = Yes
browseable = no
writable = no
create mask = 0700
directory mask = 0700
valid users = %S
hide dot files = yes

;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; write list = root

;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700

;[users]
; comment = All users
; path = /home
; read only = No
; inherit acls = Yes
; veto files = /aquota.user/groups/shares/

;[groups]
; comment = All groups
; path = /home/groups
; read only = No
; inherit acls = Yes

[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
public = no
writable = no
create mode = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
write list = root, @lpadmin

# A sample share for sharing your CD-ROM with others.
;[cdrom]
; comment = CD-DVD
; writable = no
; locking = no
; path = /cdrom
; public = yes
; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom

# A sample share for sharing Hylafax recived folder with others.
;[FAX]
; comment = Archivio fax
; inherit acls = Yes
; path = /var/lib/samba/fax
; read only = No
; create mask = 0777
; force create mode = 0777
; force security mode = 0777
; directory mask = 0777
; guest only = no
; guest ok = yes
; hide dot files = yes
; vfs object = recycle
; recycle:repository = .deleted/%U
; recycle:keeptree = Yes
; recycle:touch = Yes
; recycle:versions = Yes
; recycle:maxsixe = 0
; recycle:exclude = *.tmp
; recycle:exclude_dir = /tmp
; recycle:noversions = *.doc

[Pubblica]
comment = Cartella pubblica
inherit acls = Yes
path = /home
read only = No
create mask = 0777
force create mode = 0777
force security mode = 0777
directory mask = 0777
guest only = yes
guest ok = yes
hide dot files = yes
hide files = /.*
hide special files = no
hide unreadable = no
hide unwriteable files = no
vfs object = recycle
recycle:repository = .deleted/%U
recycle:keeptree = Yes
recycle:touch = Yes
recycle:versions = Yes
recycle:maxsixe = 0
recycle:exclude = *.tmp
recycle:exclude_dir = /tmp
recycle:noversions = *.doc

[C]
comment = Hard Disk protetto
inherit acls = Yes
path = /
read only = Yes
create mask = 0777
force create mode = 0777
force security mode = 0777
directory mask = 0777
guest only = no
guest ok = no
hide dot files = no
vfs object = recycle
recycle:repository = .deleted/%U
recycle:keeptree = Yes
recycle:touch = Yes
recycle:versions = Yes
recycle:maxsixe = 0
recycle:exclude = *.tmp
recycle:exclude_dir = /tmp
recycle:noversions = *.doc

Adesso sarà sufficente creare le cartelle di cestino nei path condivisi:
sudo mkdir /.deleted
sudo mkdir /home/.deleted
sudo mkdir /var/lib/samba/fax/.deleted
Ed assegnare i permessi a queste ultime:
sudo chmod -R 777 /.deleted /home/.deleted /var/lib/samba/fax/.deleted
Riavviate samba:
sudo /etc/init.d/samba restart
Ora godetevi il vostro server con cestino di rete!
Ciao
Swipon

Nessun commento: