SOLVED use root Login CIFS(access is denied)

Fei

Explorer
Joined
Jan 13, 2014
Messages
80
Hello,

I have a problem.
I share CIFS and I wanna ues it.
I use root account (access denied),but I ues haha account(user:haha group:wheel) is OK!!
root ->access denied
haha -> OK!

why can use "haha" ? (root always access denied)

system


volume permission


User configuration


CIFS share configuration




My English very poor .........
sorry :(
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
I don't think "root" (FreeNAS root) has access to Windows.. Even if you did have a "root" account on Windows I probably would advise against it.. Windows has enough issues without having "root" or "admin" account..
 

Fei

Explorer
Joined
Jan 13, 2014
Messages
80
Hi Yatti420,

I use previous FreeNAS (9.2.1.3) ,can use"root" login CIFS share......why?


I don't think "root" (FreeNAS root) has access to Windows.. Even if you did have a "root" account on Windows I probably would advise against it.. Windows has enough issues without having "root" or "admin" account..
 

Blue Thunder

Cadet
Joined
Dec 5, 2015
Messages
1
It has been more than a year since anyone has made a post here but I thought this might help someone with the same problem as Fei. I think I ran into this exact same issue and solved it, but I can't seem to view the full size images that Fei posted so I'm a little unsure.

I'm using the latest stable FreeNAS 9.3.1 as of writing (FreeNAS-9.3-STABLE-201511280648.iso), so my solution/workaround might not work for you.

I fixed the issue by changing root's password via the WebGUI. To do this:
1. Go to the "Accounts" page
2. Click on the "Users" tab
3. Locate and select the user "root"
4. Click on the "Modify" button located at the bottom of the page and a dialogue window will open
5. Enter a password, twice, and click on the Save? button located at the bottom of the dialogue window

You'll then be able, from a Windows-based machine, to access CIFS/SMB shares on the FreeNAS machine by logging in as root. For my situation (see below), this allowed me to modify the permissions for folders on my share.

Some background/advice?:
If you're trying to set up a CIFS/SMB share then you probably should follow this guide instead (https://forums.freenas.org/index.ph...-of-how-to-configure-share-permissions.35276/). Unfortunately for me, I didn't.

As explained here (https://forums.freenas.org/index.php?threads/all-my-windows-shares-are-world-readable.29012/), to modify permissions for objects (e.g. folders, files) on a share with Permission Type = Windows, you need to either use a Windows-based client or the setfacl command from FreeNAS's CLI. I chose to use a Windows-based client to set up the permissions on my share, rather than using setfacl.

By default for any shares you create, the owner is set to "root" and the group is set to "wheel". If you don't change this, then only root (and maybe other users that are in the "wheel" group?) can modify the permissions for objects (e.g. files, folders) on the share. This is what I had done when I created my share.

So my situation was that I needed to login to my share from a Windows-based client as "root" because it was the only account that could modify the permissions of objects on the share so that I could allow or deny other users the ability to read/write to certain areas. Initially I couldn't login as root, but as explained above, changing root's password fixed the issue.

However, it might not a good idea to login as root over SMB because the connection (at least in Microsoft's implementation) isn't encrypted unless you're using SMB 3.0 (or IPSec), which was released as part of Windows 8.0 and Windows Server 2012.

If I had followed the thread linked above "Simple example of how to configure share permissions" then I probably wouldn't have run into this issue. I could've also created an admin user and assigned the existing share's ownership/group to that user, but I wasn't confident about what would happen if I tried to change the ownership on an existing share with the Permission Type = Windows.

It's an unrelated issue but I noticed this thread/post (https://forums.freenas.org/index.php?threads/permissions-not-saved.24745/#post-153888) mentions issues with changing the Permission Type from Windows to UNIX. That made me nervous about running into problems when changing the ownership/group.

Although for Permssion Type changes, this post (https://forums.freenas.org/index.php?threads/permission-changes-doesnt-save.11854/#post-61271) and the current documentation says it's fine (http://doc.freenas.org/9.3/freenas_storage.html#volumes).
 
Last edited:

Fei

Explorer
Joined
Jan 13, 2014
Messages
80
Hi

Thanks your reply , I follow your step ,I resolve the issue.
 
Top