Preface: I know that many people have asked similar questions over the years. I have read many responses to these questions, and blog entries on other sites, but I am still unable to configure samba to do what I want.
I have two Linux computers (running Fedora 37) on a local network, pw-tower and pw72. pw-tower has some data files that I want to be able to read (not write) from pw72. Because the data files are not sensitive, and because I am making the files read-only from pw72, I want the convenience of not having to type a password each time I want to mount the share.
pw-tower hosts a Samba server. Here are the relevant sections from /etc/samba/smb.conf:
[global]
workgroup = WORKGROUP
server string = Samba Server Version %v
netbios name = pw-tower
hosts deny = ALL
hosts allow = 192.168.1. 127.
interfaces = enp1s0 lo
guest account = repair
security = user
passdb backend = tdbsam
[data]
comment = Shared data stored on a large removeable drive
path = /run/media/david/D2T-07202016/data
browseable = yes
read only = yes
guest ok = yes
writable = no
There is a 'repair' account on both pw-tower and pw72. They each have the same password. Plus I used smbpasswd to set the same password for 'repair' on pw-tower.
I set the permissions for /run/media/david/D2T-07202016/data so that the 'repair' user can read this directory.
$ ls -ld /run/media/david/D2T-07202016/data
drwxrwxrwx. 14 david samba_file_readers 4096 Jun 3 09:32 /run/media/david/D2T-07202016/data
Both 'david' and 'repair' are members of the 'samba_file_readers' group.
Finally, I am trying to mount the 'data' share on pw72 with commands such as the following:
sudo mount -t cifs //pw-tower/data /mounts/pw-tower-data -o username=repair,sec=none,guest
I either get prompted for a password or I get a permission denied error (mount error(13): Permission denied).
The only way I have been able to log in without typing a password is by setting up a credentials file for 'david' on pw72. But this is not a permanent solution because I am not comfortable having my password in a plaintext file no matter what the file's permissions are. When I set up a similar credentials file for 'repair', I got permission denied. I would be OK with having the 'repair' password in a file although it is not ideal.
I know that Samba works slightly differently on some Linux computers. I know that guest access is supported and many people have gotten it to work. I am open to any suggestions.