I was about to post some more error messages as some form of progress, but I had the notion to try some commands again and found one of these final ones ended my journey successfully, and as I don't see an answer already posted, I'll take what I used from Kenneth that helped me and add it here myself:
This was causing issues for me on Fedora Linux 35 Workstation with my exFAT USB external hard disk drive that I had already been using fine in Files/Nautilus that would be only to my user account.
To be sure I wasn't just unfamiliar with Samba, I used commands such as man smb.conf to edit the /etc/samba/smb.conf file with more knowledge, and testparm to validate the configuration.
sudo mount /dev/sd?? '/mnt/...' -o 'nosuid,nodev,nofail,noauto,x-gvfs-show,context="system_u:object_r:samba_share_t:s0"'
https://ask.fedoraproject.org/en/question/62838/selinux-ntfs-samba-share-problemworkaround/
That is the command that completed my solution.
It utilizes the same method of masking filesystem attributes like I had found in tutorial pages with my Fedora Linux distribution here: https://docs.fedoraproject.org/en-US/quick-docs/samba/ https://www.tecmint.com/setup-samba-file-sharing-for-linux-windows-clients/
sudo semanage fcontext --add --type "samba_share_t" /mnt/... sudo restorecon -R /mnt/...
I was able to test that was necessary earlier using these broader commands:
> sudo setenforce Permissive > sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: enforcing Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed Memory protection checking: actual (secure) Max kernel policy version: 33
https://www.thegeekdiary.com/centos-redhat-how-to-set-selinux-modes/ I had also noticed the bare directory when unmounted was a mnt_t, and when mounted and dysfunctional with Samba was dosfs_t.
I checked these with this command: ls -ldZ where the Z was key. l is enough for me, but some used getfacls for a more verbose display.
https://superuser.com/questions/617777/how-do-i-auto-mount-a-usb-drive-that-all-users-can-write-to I had also thought of the user mount option, but it is unnecessary now, at least for solving this problem for me.
2 more SELinux commands may have been helpful, but I could not generate any console or log output with them, with or without the '-d' option, audit2why and audit2allow. https://opensource.com/article/18/12/troubleshooting-hardware-problems-linux
The firewall commands allowed other systems to connect.
I was able to test locally using these:
> smbclient --user="<user>%<password>" -L '//<machine>/<share>' Sharename Type Comment --------- ---- ------- print$ Disk Printer Drivers ... Disk smbtest Disk testing IPC$ IPC IPC Service (Samba #.#.#) SMB1 disabled -- no workgroup available > smbclient --user="<user>%<password>" '//<machine>/<share>' --command 'ls' `NT_STATUS_ACCESS_DENIED listing \*` > journalctl -u smb -b ...... chdir_current_service: vfs_ChDir(<path>) failed: Permission denied. Current token: uid=#, gid=#, 1 groups: # ...... ...NT_STATUS_INTERNAL_ERROR...
I had already set a custom manual mount line for in /etc/fstab through the Disks GUI, and manually as well, having it be mounted under /mnt/... instead of only to my user under /run/... trying to open the permissions for users and groups more, but other had read permission throughout, so that was misleading.
I may have tried other methods from articles such as these but with messy situations encountered these error messages and thought they were completely ineffective: Sharing a mounted drive with samba on CentOS7
mount: <path>: wrong fs type, bad option, bad superblock on /dev/sd??, missing codepage or helper program, or other error. SELinux: mount invalid. Same superblock, different security settings for (dev sd??, type exfat)
> sudo semanage fcontext --add --type "samba_share_t" '/mnt/...' ValueError: File specification can not include spaces
That was incorrect anyway, as I needed the mentioned mask option to mount anyway, so I did not need to work out a correct file context pattern that worked such as suffixes like (/.*)? or partial names with wildcards too, where I had the idea when trying this command: sudo semanage fcontext -l | less.
That did not work for me earlier as I saw I was not able to change security settings with a remount, thus why it works later now only using the context option alone that I thought I had done already.
It's also possible something is still strange between me using the terminal to mount the drive vs. the Disks GUI now that I had the updated file system table file. I think I have the same options lines and in the correct order, but one method is still giving me a dosfs_t..
Other useful commands: sudo umount '/mnt/...'
lsblk
dmesg | less Since I have little logs in the var folder for any service, possibly using systemd to contain them.
smbpasswd
smbstatus
sudo pdbedit -L
cat /etc/passwd | grep <user>