Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1
                                valid   users   =   %S
read only = No
create mask = 0664
directory mask = 0775
browseable = No

If you have a default [homes] section, the share shows up in the user’s
Network Neighborhood as the user’s name. When the user connects, Samba
scans the existing sections in smb.conf for a specific instance of the user’s
/home directory. If there is not one, Samba looks up the username in
/etc/passwd. If the correct username and password have been given, the
home directory listed in /etc/passwd is shared out at the user’s /home
directory. Typically, the [homes] section looks like this:


Click here to view code image
[homes]
browseable = no
writable = yes


The browseable = no entry in this example prevents other users from
being able to browse the /home directory and is a good security practice.


This example shares out the /home directory and makes it writable to the
user. Here’s how you specify a separate Windows /home directory for each
user:


Click here to view code image
[homes]
browseable = no
writable = yes
path = /path/to/windows/directories


Sharing Printers by Editing the [printers] Section

The [printers] section works much like the [homes] section but
defines shared printers for use on your network. If the section exists, users
have access to any printer listed in your Ubuntu /etc/printcap file.


As with the [homes] section, when a print request is received, all the
sections are scanned for the printer. If no share is found (with careful naming,
there should not be a share found unless you create a section for a specific
printer), the /etc/printcap file is scanned for the printer name that is
then used to send the print request.


For printing to work properly, you must correctly set up printing services on
your Ubuntu computer. A typical [printers] section looks like this:

Free download pdf