Datasets as home "folder"

Status
Not open for further replies.

CrazyKay

Cadet
Joined
Nov 3, 2013
Messages
8
Hello everybody,

I'm struggling with setting up home folders where every home "folder" actually is a dataset. I'm running freeNAS 9.10

Concrete it looks like this

  • /tank/home/user1
  • /tank/home/user2
  • ...
  • /tank/home/userm
I've created the necessary dataset and afterwards I've created the user. As I created the user I set the option Create Home Directory In to /tank/home/ .

Then I've created a CIFS share home and set the option Use as home share and unselect the option Browsable to Network Clients. If I access my freeNAS I see the folder user1, user2, ..., userm but if I try to access it I get an error message. The funny thing is if I create a usern and let the wizard create a FOLDER usern inside of the dataset /tank/home I can access the folder.

My smb4.conf looks like this

Code:
[global]
  server max protocol = SMB3_11
  encrypt passwords = yes
  dns proxy = no
  strict locking = no
  oplocks = yes
  deadtime = 15
  max log size = 51200
  max open files = 940106
  logging = file
  load printers = no
  printing = bsd
  printcap name = /dev/null
  disable spoolss = yes
  getwd cache = yes
  guest account = nobody
  map to guest = Bad User
  obey pam restrictions = yes
  directory name cache size = 0
  kernel change notify = no
  panic action = /usr/local/libexec/samba/samba-backtrace
  nsupdate command = /usr/local/bin/samba-nsupdate -g
  server string = FreeNAS Server
  ea support = yes
  store dos attributes = yes
  lm announce = yes
  hostname lookups = yes
  time server = yes
  acl allow execute always = true
  dos filemode = yes
  multicast dns register = yes
  domain logons = no
  local master = yes
  idmap config *: backend = tdb
  idmap config *: range = 90000001-100000000
  server role = standalone
  netbios name = FREENAS
  workgroup = WORKGROUP
  security = user
  pid directory = /var/run/samba
  create mask = 0666
  directory mask = 0777
  client ntlmv2 auth = yes
  dos charset = CP437
  unix charset = UTF-8
  log level = 10
  shadow:snapdirseverywhere = yes


[homes]
    valid users = %U
    path = /tank/home/%U
    comment = Home Directories
    printable = no
    veto files = /.snapshot/.windows/.mac/.zfs/
    writeable = yes
    browseable = no
    vfs objects = zfs_space zfsacl aio_pthread streams_xattr
    hide dot files = yes
    guest ok = no
    nfs4:mode = special
    nfs4:acedup = merge
    nfs4:chown = true
    zfsacl:acesort = dontcare
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Hello everybody,

I'm struggling with setting up home folders where every home "folder" actually is a dataset. I'm running freeNAS 9.10

Concrete it looks like this

  • /tank/home/user1
  • /tank/home/user2
  • ...
  • /tank/home/userm
I've created the necessary dataset and afterwards I've created the user. As I created the user I set the option Create Home Directory In to /tank/home/ .

Then I've created a CIFS share home and set the option Use as home share and unselect the option Browsable to Network Clients. If I access my freeNAS I see the folder user1, user2, ..., userm but if I try to access it I get an error message. The funny thing is if I create a usern and let the wizard create a FOLDER usern inside of the dataset /tank/home I can access the folder.

My smb4.conf looks like this

Code:
[global]
  server max protocol = SMB3_11
  encrypt passwords = yes
  dns proxy = no
  strict locking = no
  oplocks = yes
  deadtime = 15
  max log size = 51200
  max open files = 940106
  logging = file
  load printers = no
  printing = bsd
  printcap name = /dev/null
  disable spoolss = yes
  getwd cache = yes
  guest account = nobody
  map to guest = Bad User
  obey pam restrictions = yes
  directory name cache size = 0
  kernel change notify = no
  panic action = /usr/local/libexec/samba/samba-backtrace
  nsupdate command = /usr/local/bin/samba-nsupdate -g
  server string = FreeNAS Server
  ea support = yes
  store dos attributes = yes
  lm announce = yes
  hostname lookups = yes
  time server = yes
  acl allow execute always = true
  dos filemode = yes
  multicast dns register = yes
  domain logons = no
  local master = yes
  idmap config *: backend = tdb
  idmap config *: range = 90000001-100000000
  server role = standalone
  netbios name = FREENAS
  workgroup = WORKGROUP
  security = user
  pid directory = /var/run/samba
  create mask = 0666
  directory mask = 0777
  client ntlmv2 auth = yes
  dos charset = CP437
  unix charset = UTF-8
  log level = 10
  shadow:snapdirseverywhere = yes


[homes]
    valid users = %U
    path = /tank/home/%U
    comment = Home Directories
    printable = no
    veto files = /.snapshot/.windows/.mac/.zfs/
    writeable = yes
    browseable = no
    vfs objects = zfs_space zfsacl aio_pthread streams_xattr
    hide dot files = yes
    guest ok = no
    nfs4:mode = special
    nfs4:acedup = merge
    nfs4:chown = true
    zfsacl:acesort = dontcare

That sounds like the normal behavior for [homes] in Samba. See here: https://www.samba.org/samba/docs/man/manpages/smb.conf.5.html
Samba is dynamically creating a share to /mnt/tank/home/<username> after a user has authenticated, but the only way this works out is if a folder /mnt/tank/home/<username> exists.
 

CrazyKay

Cadet
Joined
Nov 3, 2013
Messages
8
That sounds like the normal behavior for [homes] in Samba. See here: https://www.samba.org/samba/docs/man/manpages/smb.conf.5.html
Samba is dynamically creating a share to /mnt/tank/home/<username> after a user has authenticated, but the only way this works out is if a folder /mnt/tank/home/<username> exists.

So Samba has a problem that the home dir , let's say for user1, isn't a folder rather than a dataset? The dataset /mnt/tank/home/user1 does exist and it's presented to me after logging in into windows with a user user1 and the same password as set in freeNAS. The Problem is that I'm not able to access that share.

If I do the same with a FOLDER user2 at the dataset/mnt/tank/home/ and I login into Windows I do see the share and I'm able to access it.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
So Samba has a problem that the home dir , let's say for user1, isn't a folder rather than a dataset? The dataset /mnt/tank/home/user1 does exist and it's presented to me after logging in into windows with a user user1 and the same password as set in freeNAS. The Problem is that I'm not able to access that share.

If I do the same with a FOLDER user2 at the dataset/mnt/tank/home/ and I login into Windows I do see the share and I'm able to access it.
Sounds like a permissions issue. tank/home and tank/home/user1 are distinct filesystems when "user1" is a dataset. You need to set / verify appropriate permissions on tank/home/user1.
 
Status
Not open for further replies.
Top