Just a note on your immediate symptom:
installed samba, can get it working if the other machine connecting to it via windows has the same username and password as a samba user but cant with any other user.
It's because you did this:
Where is it best to store network shares (what location on the server) i currently have a share under my main user ( This is not a prod server just me messing about learning how to use samba, how it works and how to set it up)
It's not that you created a share of something in your home folder since that is permitted it's because of the permissions of the home folder itself in Ubuntu 22.04.
Run this command to find the permissions of your home folder:
It should come back with something like this:
~$ ls -dl $HOME
drwxr-x--- 5 tester tester 4096 May 13 19:33 /home/tester
The user tester can read/wite but access is denied at the Linux permissions level to everyone else.
Samba permissions and Linux permissions have to be in sync so if you create a share of say your Documents folder in smb.conf like this:
[Documents]
path = /home/tester/Documents
read only = no
Only one user will gain access to that share and that is tester.
If you want to connect to that share from a Windows user named agnes samba will allow it ( if agnes has ben added to smbpasswd ) but Linux will reject it since agnes will not get pass the /home/tester folder.
One way ( there are limitless variations in Samba ) is to make agnes appear to be tester - for this share:
[Documents]
path = /home/tester/Documents
read only = no
force user = tester
Agnes will still be prompted for credentials to gain access but once it's accepted everything she does will be as user tester.
Remember to restart smbd when you edit smb.conf:
Code:
sudo service smbd restart