I'm used to setting up Samba shares through Nautilus (GTK 2), which is rather easy. However, I haven't used it in a long time, and now I use Xubuntu, which uses Thunar. So, I decided to try setting up a Samba share through the command-line, editing pertinent text files and such.
I have been successful in viewing my own share from the server, entering the password for the user I created with
sudo smbpasswd -a <user_name>
The only username it would let me create was the same as that of my logged in user for my computer. I have been successful with viewing the share as a guest from a client computer.
However, I have not been able to view the share from the client computer with a username and password. I tried using the same username and password that worked from the server, to no avail. It did ask for a password, but didn't recognize the username/password. I tried creating another user from the server (for that computer, and then I made a samba user with the same name) with the name of the logged in user on my client computer (to no avail).
Here's what I appended to the end of
/etc/samba/smb.conf (with three spaces for the indent instead of four, since that's what the file does):
[myPath] path = /home/myUser1/myPath read only = no writeable = yes valid users = myUser1 myUser2 create mask = 0664 directory mask = 0775 force user = myUser1
I did make sure to set the permissions on the shared folder to 775, and I did
sudo chown -hR myUser1:myUser2 myPath—again, to no avail (except for guest access).
What else do I need to do?
Similar questions exist, but they don't seem to be having the same problem. Maybe they know something I don't.
For reference, to allow guests to log in, I just replace
valid users = myUser1 myUser2 above with
guest ok = yes, and it works fine from the client after I do
sudo service smbd restart.
To be clear, myUser1 is the name of the logged in user on the server. myUser2 is the name of the logged in user on the client. I even tried creating a Samba user named myUser1 on the client (to no avail).
I read something once about how you need to activate Samba users after creating them, but I wasn't too clear on the details and if it really was necessary as stated, since hardly anyone who talks about creating Samba shares ever mentions it, as far as I've seen, and the file they mentioned editing didn't exist.
Perhaps instead of setting the group to be the user with the same name as my client, maybe I need to make
sambashare to be the group. Maybe I need to create a Samba user named myUser2 on my client.
My client uses Xubuntu 16.10 (64-bit), and my server uses the one before that (Xubuntu 16.04—32-bit).