Samba – error 255: net usershare add: cannot share path

La «red compartida» devolvió el error 255:
net usershare add: cannot share path /media/DATOS/Cosas as we are
restricted to only sharing directories we own.
Ask the administrator to add the line "usershare owner only = false"
to the [global] section of the smb.conf to allow this.

Este mensaje de error apareció al intentar compartir un directorio de una partición NTFS montada utilizando el fichero fstab, concretamente, cuando no somos propietarios del directorio que queremos compartir.

Es un error bastante sencillo de corregir, el mismo mensaje de error nos da la solución. El primer paso será editar el fichero smb.conf que encontraremos en /etc/samba.

$ sudo gedit /etc/samba/smb.conf

En mi caso, he buscado la zona donde se encuentran las opciones usershare, y he añadido la opción usershare owner only = false.

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.
usershare owner only = false

# Maximum number of usershare. 0 (default) means that usershare is disabled.
;   usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
   usershare allow guests = yes

Guardamos el fichero smb.conf, y listo, ya podremos compartir sin problemas.