I have two Ubuntu machines which I access via terminal (over PuTTY) on a Windows machine.
I use a script on one Ubuntu machine to create network shares (and users to access them) and a script on the other Ubuntu machine to mount those shares. The share creation script uses the following lines of code for each share to be created:
chmod -R 777 /media/hdd/shares/$Username useradd $Username (echo $Password; echo $password) | smbpasswd -a -s $Username echo >> /etc/samba/smb.conf echo [$Username] >> /etc/samba/smb.conf echo path = /media/hdd/shares/$Username >> /etc/samba/smb.conf echo browsable = yes >> /etc/samba echo read only = no >> /etc/samba/smb.conf echo writable = yes >> /etc/samba/smb.conf echo valid users = $Username >> /etc/samba/smb.conf
(before any of this takes places, the script restores the smb.conf file to its default, shareless state)
This code is iterated through twice with a different $Username and $Password both times. The $Username and $Password values are stored in a file that both Ubuntu machines have access to, so that the other one can use the same values and mount the shares. This comes off without a hitch; both of the shares mount on the other machine.
However, on Windows I'm only able to mount one of the two shares. I'm completely at a loss for how to even troubleshoot this. I suspect there may be a difference between the two user accounts but I don't know where to check.
I need both shares to mount on Windows. How can I resolve this?
EDIT: Solved. By switching "valid users" to "force user" it behaves as expected now. No idea what difference this makes.
EDIT 2: Not actually solved. Switching to "force user" allows any share to be accessed by any valid set of credentials. I've gone back to using "valid users". The issue has gotten more interesting after a friend used another windows PC (both of us are Win10 1709) to try connecting to the shares and he is able to connect only to the share that I can't reach.