How does the 'Home Directory' feature actually work?

Status
Not open for further replies.

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
I'm going to start off by stating what I think I understand.

Places to modify 'Home Directory' settings.
1. Services --> CIFS settings --> 3 settings
* enable home directories -> this makes a network share apear on the network called 'homes'
* enable home directory browsing -> this allows you to browse using GUI
* home directory path -> I assume this is the directory where home directories should be placed for every user.

2. Users --> username --> Home Directory
* I think this should be the actually directory that the users should get when they connect to the 'homes' share.

So what I have configured is under the CIFS service setting I have home directories turned enabled with browsing enabled and I have the path set to /mnt/Data/homes. To go with this I have also configured a dataset called 'homes' that is /mnt/Data/homes. So I have a dataset configured to be the home directory for the CIFS services settings. Now for each user on the system I have configured their Home Directory setting to be /mnt/Data/homes/<username>. Now if you try to log-in I would expect that the directory gets auto created for that username. This doesn't happen so I manually created the user directory and chown'ed for the correct user and group. After this I am still getting errors when trying to connect to the 'homes' share.

So what I would like to know is does this feature not work I think it works or am I using it wrong. I think it should create a home share that when a user logs in they get routed to their home directory.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Ok so I have some ideas of the specifics.

The config option that you set in the "Users" settings are what are used when a user is working locally. So all of your '.config' files get placed there. But this setting doesn't seem to have anything to do with cifs homes directory.

The way I think the cifs home directory works is that it looks at the username that comes over the wire does auth with that username then converts that username into lowercase then tries to find a directory path that is in the cifs home directory setting.

Example:
Username over the wire: Bob
password: a
cifs home dir path: /mnt/tank/homes

auth happens with Bob/a with the local user account then it uses bob(lowercase) to find the home dir path in /mnt/tank/homes/bob. If that path exists then everything works if that path doesn't exist then you get a "system error 53, network path not found".

so basically you need to have your datasets for your users all lowercase. I'm not sure if this is from the SMB client changing it to lowercase of freenas cifs server changing it to lower case. a pcap would tell me, so maybe my next step. I'm also looking at some auxiliary parameters for the 'homes' share to see if that can fix it.
 
Status
Not open for further replies.
Top