In the event that a user cannot successfully connect to a share, you can specify a default share to which they can connect. Since you do not know who will default to this share at any time, you will probably want to set the
guest
ok
option to
yes
for this share. Specifying a
default
service
can be useful when sending the utterly befuddled to a directory of help files. For example:
[global]
...
default service = helpshare
...
[helpshare]
path = /home/samba/helpshare/%S
browseable = yes
guest ok = yes
comment = Default Share for Unsuccessful Connections
volume = Sample-Data-Drive
writeable = no
Note that we used the
%S
variable in the
path
option. If you use the
%S
variable, it will refer to the requested nonexistent share (the original share requested by the user), not the name of the resulting default share. This allows us to create different paths with the names of each server, which can provide more customized help files for users. In addition, any underscores ( _ ) specified in the requested share will be converted to slashes ( / ) when the
%S
variable is used.