Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux:samba [2009/11/10 08:38]
greebo
linux:samba [2013/09/17 12:32] (current)
zagi [Share Definitions]
Line 16: Line 16:
       add machine script = /usr/sbin/useradd -n -g machines -d /dev/null -s /sbin/nologin %u       add machine script = /usr/sbin/useradd -n -g machines -d /dev/null -s /sbin/nologin %u
    
 +
 +<pre>
 +@ECHO OFF
 +if %username%==GOST goto izhod
 +NET USE Z: /HOME /YES
 +NET USE G: \\SERVER\USERS
 +NET USE H: \\SERVER\MEDIA
 +NET TIME \\SERVER /SET /YES
 +:izhod
 +</pre>
 +
 <html><pre> <html><pre>
 pdbedit --pwd-must-change-time=timestamp username pdbedit --pwd-must-change-time=timestamp username
Line 82: Line 93:
 The “vfs object” line calls in the plug-in that enables recycle bin capability.  On the other lines, you’re setting the name of the recycle bin directory, telling Samba to preserve the whole structure of any directories that a user may delete, and finally, telling it to not keep certain types of files.  The “vfs object” line calls in the plug-in that enables recycle bin capability.  On the other lines, you’re setting the name of the recycle bin directory, telling Samba to preserve the whole structure of any directories that a user may delete, and finally, telling it to not keep certain types of files. 
  
 +==== newer version ====
 +
 +If the required version of Samba is not installed, there are articles on how to update/install the correct version of Samba.
 +
 + 
 +
 +To implement the network recycle folder Samba uses a Virtual File System (VFS) module. The various VFS modules that Samba can use are in the local directory: //usr/lib/samba/vfs
 +
 +
 +Documentation on the options for the recycle.so module and other VFS modules can be found in the local directory //usr/share/doc/samba-x.x/docs/Samba-HOWTO-collection.pdf under chapter 19 or on the following website: http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/VFS.html
 +
 +To implement a Samba recycle folder simply edit one of your shares to be similar to the example below:
 +
 + 
 +**''/etc/samba/smb.conf''**
 +<code>
 +#============================ Share Definitions ==============================
 +[SambaShare]
 +
 +   path = /home/scripts
 +   public = yes
 +   writable = yes
 +   browsable = yes
 +
 +vfs object = recycle
 +        recycle:repository = .deleted/%U
 +        recycle:keeptree = Yes
 +        recycle:touch = Yes
 +        recycle:versions = Yes
 +        recycle:maxsize = 0
 +        recycle:exclude = *.tmp
 +        recycle:exclude_dir = /tmp
 +        recycle:noversions = *.doc
 +
 +</code>
 + 
 +
 +This configuration only implements a recycle folder on the directory "Samba Share". The above options must be specified for each Samba share you want the recycle folder functionality on.
 +
 + 
 +
 +The most interesting option above is:
 +
 + 
 +   recycle:repository = .deleted/%U
 +
 +
 +
 +This specifies where the deleted files will be stored. This is relative to the share path. From the above example "Samba Share" has the path /home/scripts. Therefore anything that is deleted is moved to the directory .deleted under this path. The %U variable is the username of the person currently browsing the share. So for every user that deletes a file there is a directory with their username containing all the files they have deleted.
 +
 + 
 +
 +For example:
 +
 +Scott is browsing the "Samba Share" directory and deletes a file. The deleted file can now be found under /home/scripts/.deleted/Scott \\
 +Brad is browsing the "Samba Share" directory and deletes a file. The deleted file can now be found under /home/scripts/.deleted/Brad \\
 +
 +
 +It is important to note that the .deleted directory must be created prior to use. It must then allow users to write to that directory. This is just an example and can be setup differently to suit your particular situation.
  
 ====  How can I list the currently active clients? ==== ====  How can I list the currently active clients? ====
Line 110: Line 180:
 === smb.conf === === smb.conf ===
 <pre> <pre>
-#======================= Global Settings ======================= +# 
 +======================= Global Settings ======================= 
 +<code>
 [global] [global]
  
Line 351: Line 422:
    usershare allow guests = yes    usershare allow guests = yes
  
-#======================= Share Definitions ======================= +</code> 
 +# 
 +======================= Share Definitions ======================= 
 +<code>
 # Un-comment the following (and tweak the other settings below to suit) # Un-comment the following (and tweak the other settings below to suit)
 # to enable the default home directory shares.  This will share each # to enable the default home directory shares.  This will share each
Line 480: Line 553:
 #      #hide files = /.recycle.*/.recycle/ #      #hide files = /.recycle.*/.recycle/
 #      #veto files = /.recycle.*/.recycle/ #      #veto files = /.recycle.*/.recycle/
-</pre>+</code>
  
linux/samba.1257838691.txt.gz · Last modified: 2009/11/10 08:38 by greebo
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready