How Linux Works: What Every Superuser Should Know

14.4 Sharing Files

To export a directory to SMB clients (that is, to share a directory with a client), add a section like this to your smb.conf file, where label is what you would like to call the share, and path is the full directory path:

[ label ] path = path comment = share description guest ok = no writable = yes printable = no

These parameters are useful in directory shares:

14.4.1 Home Directories

You can put a special section called [ homes ] in your smb.conf file if you want to export home directories to users. The section should look like this:

[homes] comment = home directories browseable = no writable = yes

By default, Samba reads the logged-in user 's /etc/passwd entry to determine the user's home directory for [homes] . However, if you don't want Samba to follow this behavior (that is, you want to keep the Windows home directories in a different place than the regular Linux home directories), you can use the %S substitution in a path parameter. Here is an example that switches a user's [homes] directory to /u/ user :

path = /u/%S

Samba substitutes the current username for the %S .

Категории