Permissions Configuration on Windows & Ubuntu Hybrid Network

Status
Not open for further replies.

Jayden67

Dabbler
Joined
Jul 3, 2014
Messages
18
All of the tutorials I have seen so far have been on configuring FreeNAS for Windows client access, however, I am using it to backup/share files simultaneously in Windows and Ubuntu systems and need to know how to give my Ubuntu user rights to directories created in Windows. When mounting FreeNAS in Ubuntu the remote directories are owned by user root, and will not allow additional directories to be created and populated with files*. Is there something in FreeNAS that I need to configure differently (disk/user permissions) or is the issue with the way I am connecting to the server?

FreeNAS
Version: 9.2.1.5
Service: Windows CIFS
ACL is Unix, all the boxes in mode are checked for the volume & dataset.
User root & group wheel

Windows
Created folders and uploaded files to FreeNAS using a network path instead of mapping it as a drive. Also, am able to access files created by Ubuntu with no issues.

Ubuntu
Using the following command to mount FreeNAS:
Code:
 sudo mount -t cifs -o username=root //192.168.0.171/SharedFreeNASDirectory /mnt/LocalDirectory/ 

No matter what username I supply I still have the same issue. Have tried mounting as Guest, Nobody, and user accounts I created.
I believe that from Ubuntu the ownership of each directory could be changed to the logged in user, but that doesn’t seem like the right solution as there will be multiple users.
Connecting to FreeNAS through the network avoids the access/permissions issues; however the file transfer speed is significantly reduced, so that doesn’t seem like the right solution either.

My goal is to configure FreeNAS so that multiple users on different operating systems (Windows and Ubuntu) have full access to the same VOLUMNE?

*In an attempt to state the problem and question as direct and succinctly as possible I omitted a few details:
• Directories can be created and are owned by user nobody, but have the lock icon and will not allow any files inside them.
Files can be copied to already existing directories but they also get the lock icon.
• When copying directories containing files and subdirectories only the top level directory is copied and gets the lock icon
• Logged in user does have the necessary access to delete files and directories.
• Creating/moving directories and files with the sudo command produces the same result.
 

AleQQ

Dabbler
Joined
Jan 22, 2014
Messages
38
According to Ubuntu's manual (which I know nothing about beyond 10 minutes of reading after a google search :p ), using
Code:
-t cifs
internally invokes mount.cifs options into the normal mount command. You may want to look at those options here.

From my short time working with Linux, i would first look at the uid and gid options for mount.cifs

Additionally, SweetAndLow's post here might also shed some light on the usage of the mount command in linux.

More importantly, both his responses to that thread as well as those of CyberJock will explain why your request has not yet seen a reply
 
Last edited:

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
AleQQ is correct, you want to try something like this.
Code:
$ sudo mount -t cifs -o uid=1000,gid=1000,rw,credentials=/root/.smbcredentials \\\\192.168.1.164/execTest ~/tmp2
$ id
uid=1000(username) gid=1000(group) groups=1000(group),...<other groups>...

If the uid on your linux client is different than the uid on FreeNAS then you will run into mount problems. Adding the uid and gid will will map the user correctly. More info can be found in the man pages "man mount.cifs". <== READ THIS

Also this sentence doesn't make sense and shows you might be missing a fundamental understanding of what you are doing.
Connecting to FreeNAS through the network avoids the access/permissions issues; however the file transfer speed is significantly reduced, so that doesn’t seem like the right solution either.
After you fix the mount options I think you will have more permission issues, these issues will be around file permissions and you couldn't pay me to help with that. Hope this helps, Good Luck!
 

Jayden67

Dabbler
Joined
Jul 3, 2014
Messages
18
More importantly, both his responses to that thread as well as those of CyberJock will explain why your request has not yet seen a reply

Thank you for the information. I didn’t realize that “permissions” was a dirty word in this forum, and I expected that getting write access to directories when mounting FreeNAS would have a simple solution. I was hoping that someone who accesses their FreeNAS server using Ubuntu would be willing to share their configuration and mount command. I’ve watched half a dozen videos on configuring it for Windows access and I really believe that outlining those basic steps for Ubuntu access would be beneficial to the community. If someone has already provided a “best practices” guide for using FreeNAS with Ubuntu I just haven’t found the forum post/YouTube video yet, and apologize for the oversight.
 

Jayden67

Dabbler
Joined
Jul 3, 2014
Messages
18
If the uid on your linux client is different than the uid on FreeNAS then you will run into mount problems. Adding the uid and gid will will map the user correctly. More info can be found in the man pages "man mount.cifs". <== READ THIS

Thanks for providing the example and explanation, I’ll read the man page and experiment with the mount options.

Question, in the credentials file what user should be specified? As you can see I’m trying to connect using the built in root userid. Is that correct for full access or do I need to create a user will full access and use that account in the username field?

Also this sentence doesn't make sense and shows you might be missing a fundamental understanding of what you are doing.

By connecting through the network I’m referring to the options at the bottom of the Nautilus file browser under the “Network” heading (Browse Network and Connect to Server). I’m a noob in Ubuntu as well, sorry if I confused you by using the wrong terminology.
 

Attachments

  • Nautilus File Browser.png
    Nautilus File Browser.png
    30.8 KB · Views: 237

AleQQ

Dabbler
Joined
Jan 22, 2014
Messages
38
Stupid mobile site and double posts
 

AleQQ

Dabbler
Joined
Jan 22, 2014
Messages
38
I'm sure someone will mention that it isn't wise to connect via root because of security something-or-other. However, I'm not wise enough in the way of freeBSD permissions to iron out all of the problems with cifs shares.

I managed to get a non-root user to connect via Windows, but that required either checking all 9 permissions boxes on the volume or by changing the volume or dataset owner to the user, group, or both of my new user. However, at least on Windows, it gets mad if you mount different network drives from the same server with different credentials (when not on ADDS). Also, I couldn't get the Windows OS backup utility to run properly unless I gave it root access to the share.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
credential file should have
Code:
username=<freenas username>
password=<username password> 

the proper way would be to make a new user to access the files. Not root. Basically it just depends on who you want to own the files on the server. when using a network protocol root and a user are basically the same.
 

AleQQ

Dabbler
Joined
Jan 22, 2014
Messages
38
when using a network protocol root and a user are basically the same.

That makes sense. I guess the need for specific users would change based on your use. My server is a home nas that only I access, so i don't care if mount as root. If I was in a business environment or had roommates using the server as storage i would want them to have users so that i could limit their shell, gui, and system folder access. But for my usage the user problem is mostly moot.
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
There's a few issues with hybrid network.. I have it working with little trouble.. Depends on Ubuntu version and how you plan to mount nas shares.. NFS and cifs are different and have different problems.. Would need to know exact errors you get from clients..

Sent from my SGH-I257M using Tapatalk 2
 

Jayden67

Dabbler
Joined
Jul 3, 2014
Messages
18
Thanks SweetAndLow and AleQQ for the bringing up the security issue and why I should create users instead of connecting as root. My network of users and computers are family members inside my house and virtual machines under my control so security wasn't much of a concern. However I would like to do this the "right way" so I will create users and assign permissions.
 

Jayden67

Dabbler
Joined
Jul 3, 2014
Messages
18
Depends on Ubuntu version and how you plan to mount nas shares.. NFS and cifs are different and have different problems.. Would need to know exact errors you get from clients..
I'm using Ubuntu 14.04, Windows 7 and CIFS because CIFS works across Windows and Linix. There are no error messages; Windows and Ubuntu clients are able to successfully connect to the FreeNAS server. The problem is that when FreeNAS is mounted in Ubuntu clients don't have full access to the directories because of ownership permissions. All uploaded files and folders get the lock icon added and files cannot be placed in the locked folders.
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
If it's permissions it can be a pain..
 
Status
Not open for further replies.
Top