SOLVED Windows Share with Windows and Linux

Status
Not open for further replies.

zokker13

Cadet
Joined
Aug 23, 2016
Messages
7
Hi everyone,

I try to set up a proper share mechanism that allows me to log into my desired share with a username and password.
Problem is that I want to do this on Windows and Linux.

Mainly I followed up those videos from monkey:
https://forums.freenas.org/index.php?resources/freenas-and-samba-cifs-permissions-video.8/

Super helpful, sadly won't cover the Linux part.


Anyway, I present you my setup (basically stolen from the video):
Dataset: "riku" (Windows)
Dataset Permissions: Owner (user): nick, Owner (group): riku

Group riku simply refers to the share riku.
User nick is supposed to be the user I log in with.
The nick user has a dedicated home directory, is member of the users and riku group and has the password "test".

Finally, I do have a riku share which points to my dataset.


First attempt to mount this with both, Windows 10 and Linux fail badly.
Windows 10 fails with a rather long error message, basically saying that multiple connections to the server with the same user can't be done.
(I used net use * /d before, did a clean restart and only attempted to navigate to the directory - still the error)
Here's the message (sadly, in German):
PGxe9yf.png


Next up is Linux.
Since CIFS _should_ be easily mounted, I was stunned that I only had read permissions.
This is my mount command:
sudo mount -t cifs //NAS/riku nick -o username=nick,password=test

The command exists successfully and I can navigate to nick.
The bad thing is that I can not write.
Performing a quick ls -lahtr shows that directory . (nick) looks like this:
Code:
drwxrwxr-x+ 1002 1005 

1002 being nick user
1005 being riku group


Luckily, I had a third option, Windows 7 on a VM (from Linux host) which could connect to the riku share with no issues (and also write).


Hope anyone of you can help me out.

Cheers.
 
Last edited:

zokker13

Cadet
Joined
Aug 23, 2016
Messages
7
*Bump* Is this not possible or is there no experience with that kind of issue?
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
If you're getting the message in Windows that you're already logged in as another user, you may either want to clear all connections to your FreeNAS box ( net use \\freenas\share /d) or reboot. If you followed the video guide and implemented everything the same way as I presented, then I can be fairly sure FreeNAS is not the issue.

As for your Linux system, when mounting a SMB share as root, or using sudo, you need to specify the the file_mode and dir_mode options: For example: file_mode=0770,dir_mode=0770.
 

zokker13

Cadet
Joined
Aug 23, 2016
Messages
7
Ahhh, okay, turn out that I need to set those permissions and set the uid and gid manually (which is totally logical when working with sudo) - thanks for that.
The promblw with Windows10 still persists. I do not have any drived mapped.
I do access the NAS using UNC paths and listen to music and all.

I'm not sure if Windows somehow shadows this but won't list it in net use.

Any idea how to work around this?


Edit: The problem seems to be gone now.
I have to say I'm not quite sure but it works now. So thanks for your help!
 
Last edited:

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
If you already have a connection to your FreeNAS box with a different username, then you have to connect using the same name. Windows will not let you connect to a SMB server with different names, therefore you must use groups to control access.
 
Status
Not open for further replies.
Top