SOLVED Help an idiot fix permissions

aussiejuggalo

Explorer
Joined
Apr 26, 2016
Messages
50
I was having problems with access my pool via SMB since upgrading Windows from 2016 - 2019 Enterprise, I was trying to fix that.

In my playing around I stupidly did the Default Permissions in the SMB shares thinking it would reset the permissions to the SMB share and nothing else but it seems to have broken all permissions for the whole NAS, I have no access to the pool from SMB, Plex has no access to the pool at all. So yeah I screwed right up :frown:. I was also an idiot and didn't do any snapshots because I thought this would be a quick fix and the snapshots that were meant to auto run haven't actually been running.

Is there a way I can "undo" this without snapshots or will I have to work out what exactly had the permissions and go from there? I set this up 4 years ago and stuffed if I can remember how I did everything.

I was planning on doing a complete reinstall eventually anyway seeing I've just been upgrading from 9.4 I think it was and some things like snapshots, S.M.A.R.T. tests etc. Haven't actually been auto running but I didn't really want to do that yet... Luckily I'm not that much of an idiot and have everything in the pool backed up externally as well.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,970
Is there a way I can "undo" this without snapshots or will I have to work out what exactly had the permissions and go from there? I set this up 4 years ago and stuffed if I can remember how I did everything.
I have no idea how to undo what you have changed. I'm curious if there is a way but I think you might be just me making some manual changes to everything. You could do a global 777 to the entire drive/pool and subdirectories, that "should" restore functionality, at least until you can make changes to lock things down as you get to them.

Good luck!
 

aussiejuggalo

Explorer
Joined
Apr 26, 2016
Messages
50
I have no idea how to undo what you have changed. I'm curious if there is a way but I think you might be just me making some manual changes to everything. You could do a global 777 to the entire drive/pool and subdirectories, that "should" restore functionality, at least until you can make changes to lock things down as you get to them.

Good luck!

Damn, was worried about that.

I did update to 11.2-U8 this morning. If I reboot to 11.2-U4.1 will that restore the permissions and everything or does that not effect permissions?

Edit, so I see that doesn't work, annoying.

Is there any negatives to just leaving all users to 777 when it's a fully private NAS? I'm the only person who really has access aside from another that has remote access to Plex.

I don't really have the time or patience to fix all this right now but I need it working. I'll do a full reinstall and set it all up again properly next year.

Edit 2, I found a config from a couple of years ago, I'll try restoring that and see if that fixes things, I haven't changed much since setting this up in 2016. Plex plugin may be a bit broken but that's easy to reinstall just time consuming.
 
Last edited:

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I found a config from a couple of years ago, I'll try restoring that and see if that fixes things,
Permissions are stored in the file system, not in the config. You are going to need to get the permissions set correctly to restore access. I have changed my permissions to be wide open to everyone so I don't need to fight this on my system.
 

aussiejuggalo

Explorer
Joined
Apr 26, 2016
Messages
50
Permissions are stored in the file system, not in the config. You are going to need to get the permissions set correctly to restore access. I have changed my permissions to be wide open to everyone so I don't need to fight this on my system.

That's damn annoying.

So running chmod 777 and giving every user complete access is perfectly fine then?

How would I go about doing the global access as well? Sorry I'm really not very good with Linux / Unix.

Edit, did chmod 777, crashed halfway through and wont let me do it again even after restoring snapshots, complaining about root being freenas.local or something :rolleyes:.

Now what lol, do I just reinstall this stupid thing and set full open permissions on reinstall? If so how do I do that. If I reinstall will it be fine to bring in my current pool or could that be stuffed up because of all of this?
 
Last edited:

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
chmod 777,
Is about the read, write, execute permissions. The permissions that you are probably having problem with is user permissions. Who can access the file, not what they can do with the file. File permissions are stored in the filesystem. Even if you reinstall the OS, the permission settings in the ZFS pool will still be the same as they were. You need to use the GUI to set the permissions to allow your user to access the files. The command line acts with root permission. If you set all the files to be available to root only, then nobody else can access the files. To give another user access, you do that from the GUI.
When you first setup your NAS, you must have created some accounts, you just need to go back and re-apply the permissions.
Take a look at the documentation:


Also, there are some good YouTube videos on setting user ACL on FreeNAS. Just don't do anything data destructive and you will be able to restore access to your data. It is just a matter of getting the permissions to match the configuration you created. I can't tell you how you setup your system.
I know that some people create user accounts for each network user that accesses the NAS and another for the Plex to access the movies, etc...
I just don't know how you did it, but don't get frustrated and do something rash.
 

aussiejuggalo

Explorer
Joined
Apr 26, 2016
Messages
50
When you first setup your NAS, you must have created some accounts, you just need to go back and re-apply the permissions.
Take a look at the documentation:

Well... I'm pretty sure I did everything with root because I having issues with setting up another user and getting it all to work nicely together then I used nobody for the SMB share because it was all guest access anyway, Plex would've been whatever the plugin did when it installed.

Is there a place to see all default FreeNAS users so I can double check?

To do permissions wide open for everyone like you've done do I just set Owner, Group, Other will full Read, Write, Execute permissions for every single user in the list?

Edit, I changed SMB Guest Account to 'root' because 'nobody' wasn't working any more so I have access to the files again, it's a bit iffy because sometimes Windows doesn't connect straight away but it's kinda working.

Plex still doesn't have access though, I can see everything on the server but trying to play anything gives a Playback Error "please check that the file exists and the necessary drive is mounted". The other thing is I can't change the Plex user permissions, I change it so it has Write permission, click save, check it again and it didn't work.

I'm currently changing the access through Windows because I'm 99% sure I had this problem years ago and changing folder permissions through Windows is what fixed it, I'll report back once that's done... It only has 15TB to go through :eek:.


Edit 2, that didn't actually take to long at all. Plex has access again so it wasn't FreeNAS or Plex but Windows.

The SMB share is still a little iffy but I was reading and it apparently has something to do with Windows not liking the older SMB version or because it's an "insecure guest logon", I've changed the guest logon in the group policies in my Windows machines but haven't forced SMB 2 from FreeNAS.
 
Last edited:

aussiejuggalo

Explorer
Joined
Apr 26, 2016
Messages
50
Marking this as solved seeing I mostly fixed it. SMB has some weirdness but I think it's a Windows issue, the NAS it's self is working fine now.
 
Top