I think what's going on is that you forgot to add myuser
as a Samba user. So as a result, you're only able to connect as a guest.
Regarding the requirement of changing permissions on the share to g+w
, I can't explain it at the moment. In my testing, I'm able to successfully connect as a guest without changing the permissions on the share. But the difference is I'm connecting from an Ubuntu client and not a Windows client. So perhaps there's something with a Windows client that is requiring the g+w
.
The fact that you have force user = myuser
as a setting should have allowed the Guest user to have write permissions, or at least take on the credentials of myuser
. But perhaps you would also need to add the following to the share in smb.conf:
create mask = 0644
directory mask = 0755
Here's a link on Stack Exchange where it looks like someone was having the same issue: How to create a Samba share that is writable from Windows without 777 permissions?
Anyway, to access a Samba share as a valid user and not a Guest, you also have to add that regular user to the list of valid Samba users.
To see a list of current Samba users, enter the following:
sudo pdbedit -L -v
Next, if you already have a regular user on your Ubuntu system such as myuser
, then skip the next step. If not, create a new user:
sudo adduser myuser
Then add mysuser
as a Samba user:
sudo smbpasswd -a myuser
If you run sudo pdbedit -L -v
again, you will see that myuser
has been added.
Within your smb.conf
, delete guest ok = yes
or change it to guest ok = no
.
Restart smbd
:
sudo systemctl restart smbd
At this point, you should be able to login to your Samba share as myuser
with write permissions.