Share Management
This section provides an overview of managing shares in Fusion SMB.
The shares discussed in this section refer to file system directories. For information on printer shares, see Printers.
Share management can also be performed using the Microsoft Management Console (MMC) snap-in. For more information, see Configuring using the Microsoft Management Console (MMC).
Adding a Share
A share can be added to Fusion SMB through either the configuration file or the command line interface (CLI).
Adding a Share Using the Configuration File
To add a share using the configuration file, follow these steps:
-
Edit the configuration file:
Open the configuration file in a text editor.
-
Add the share configuration:
Add a new
[share]section to the configuration file.importantThe
[share]sections MUST be placed below the[global]section.The most basic configuration parameters for a share are:
For advanced share configuration parameters, refer to the SMB Features and Setting and Authorization and Access Management sections where some topics address specific share behavior. For a complete list of share configuration parameters, see the share configuration reference.
The following example shows a simple share configuration:
[share]netname = MySharepath = /export/share[/share]This example creates a share named
MySharethat shares the files in/export/share. Since nopermissionsare specified, the share will have default permissions (readtoeveryone). -
Save the configuration and restart Fusion SMB:
To apply the changes you've made, save the configuration file and restart the Fusion SMB process.
Adding a Share Using the CLI
It is possible to add a share using command line tools. You'll use tsmb-cfg to configure a new share, and tsmb-server to persist the changes.
Using the CLI to configure a share is only possible if the Fusion SMB server is running.
Configuration changes made with the CLI are not persisted across server restarts, unless Fusion SMB is started in persistent configuration mode.
To add a share via the CLI, use the tsmb-cfg share add command to add a new share. The following parameters are required for adding a share:
-nor--name: The name of the share.-por--path: The path on Fusion SMB that you want to share. This must be a valid path on the server.
For more advanced share configuration parameters, refer to the tsmb-cfg share add reference for a complete list of share parameters.
For example, assuming tsmb-cfg is in your $PATH:
sudo tsmb-cfg share add -n MyShare -p /export/share
This command creates a share named MyShare that shares the files in /export/share, with default permissions (read access for everyone).
Exporting a Share over NFS
By default, the NFS service exports each share under the value of the netname
parameter of the share.
NFS clients use this export name to mount the share. To export a share under
another name, or to not export it, set nfs_export_name for the share. To change
the default for all shares, set nfs_export_name in the [global] section.
To export shares over NFS, add an NFS listener in the [global] section. See
NFS.
nfs_export_name accepts one of the following values:
netname— (default) Export the share under the value of itsnetnameparameter. For example, clients mount the sharepublicas<server>:/public.path— Export the share under the value of itspathparameter. For example, clients mount<server>:/srv/shares/public.none— Do not export the share over NFS.
The following example exports one share over both SMB and NFS:
[share]
netname = public
path = /srv/shares/public
permissions = everyone:full
nfs_export_name = netname
[/share]
With this configuration, SMB clients connect to \\<server>\public. NFS clients
mount <server>:/public. Both use the same directory.
For a share exported over SMB and NFS, use the hybrid security model.
With the posix security model, NFS clients cannot read or set NFSv4 ACLs. See
Authorization and Access Management.
Identity and access for NFS exports
Fusion NFS resolves users and groups through the same identity layer as SMB. Two points are specific to NFS:
- Authentication. NFS clients typically use AUTH_SYS, AUTH_NONE, or Kerberos
(
RPCSEC_GSS). With AUTH_SYS, the client sends the UID and GIDs of the user. The user does not need an SMB user account. To limit the security flavors of a share, setnfs_auth_flavors. For Kerberos, see Kerberos (RPCSEC_GSS). - Identity on the wire. By default, NFSv4 sends owners and groups as numeric
UIDs and GIDs. This needs no ID mapping configuration. To send them as
user@domainstrings (RFC 8881), setnfs_idmap = truefor the share. The server and the clients then need matching ID mapping configuration.
The exported directory must be on a filesystem that supports file handles
(name_to_handle_at()). Some layered or virtual filesystems, for example
overlayfs, do not support file handles. You cannot export shares on these
filesystems over NFS.
To mount an export, see Mount a Fusion NFS Export from a Linux Client.
Removing a Share
You can remove a share from Fusion SMB using the configuration file or the CLI.
Removing a Share Using the Configuration File
To remove a share using the configuration file, follow these steps:
-
Edit the configuration file:
Open the configuration file (typically,
/etc/tsmb.conf) in a text editor. -
Delete the share configuration:
Delete the
[share]section that corresponds to the share you want to remove. -
Save the configuration and restart Fusion SMB:
To apply the changes you've made, save the configuration file and restart the Fusion SMB process.
Removing a Share Using the CLI
To remove a share via the CLI, use tsmb-cfg.
Using the CLI to configure a share is only possible if the Fusion SMB server is running.
Configuration changes made with the CLI are not persisted across server restarts unless Fusion SMB is started in persistent configuration mode.
To remove a share via the CLI, use the tsmb-cfg share del command to remove a share. The following parameters are required:
-nor--name: The name of the share you want to remove.
For example, assuming tsmb-cfg is in your $PATH:
sudo tsmb-cfg share del -n MyShare
This command removes the share named MyShare.
Updating a Share
You can update a share in Fusion SMB in the following ways:
-
Using the configuration file:
You can update a share's parameters using the configuration file. In this case, you can modify any parameter, however a server restart is required to apply the changes.
-
Using the CLI:
You can update a share's parameters via the CLI. However, you can only do it while Fusion SMB is running, and only certain parameters can be modified.
Updating a Share Using the Configuration File
To update a share using the configuration file, follow these steps:
-
Edit the configuration file:
Open the configuration file in a text editor.
-
Update the share configuration:
Edit the
[share]section that corresponds to the share you want to update. -
Save the configuration and restart Fusion SMB:
To apply the changes you've made, save the configuration file and restart the Fusion SMB process.
Updating a Share Using the CLI
Using the CLI to configure a share is only possible if the Fusion SMB is running.
Configuration changes made with the CLI are not persisted across server restarts, unless Fusion SMB is started in persistent configuration mode.
To update a share via the CLI, use the tsmb-cfg share update command to update a share. The following parameters are required:
-nor--name: Identifies the share you want to update, by itsnetname. This selects which share to modify; it does not rename the share (thenetnamecannot be changed withtsmb-cfg share update).- Any parameter you want to update, such as
--remarkfor the share's comment or--hiddento hide the share. For a complete list of parameters you can update while Fusion SMB is running, see thetsmb-cfg share updatereference.
For example, assuming tsmb-cfg is in your $PATH:
sudo tsmb-cfg share update -n MyShare --hidden true
This command modifies the share named MyShare, to mark it as hidden.