Remove Domain Prefix From Usernames

wsmith

Cadet
Joined
Jan 1, 2020
Messages
2
FreeNAS 11.2-U7 running as a home multipurpose server (utilizing SMB and Domain Controller services). Everything seems to be running just fine; I can authenticate as a domain user just fine. Problem comes in when trying to connect to my home directory. Assuming my home directory is /home/wsmith and my (unix) username is `wsmith`, when I connect from a windows machine, access is being performed as "DOMAIN\wsmith", which is a different user, technically. As such, I cannot browse my home directory as the SMB account (from winbind??) and the unix account are not the same.

Ideally, I would like my domain account mapped to just plain and simple "wsmith" and have this setting persist for all users without configuring each one. It seems that this should be just as simple as getting winbind to map DOMAIN\wsmith to wsmith, but I am struggling with how to do that. Is there a "better way" to synchronize the unix accounts with the domain accounts? Basically, I'd love to be able to mount my home directory from windows *and* have the same directory for unix-y things like SFTP, etc.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,545
Are you using the SMB "homes" share for home directory access? The default path is <path>/%D/%U. So if your path for the share is /mnt/tank/homes, then it will be autocompleted as /mnt/tank/homes/DOMAIN/wsmith. If you need it to map to /mnt/tank/homes/wsmith, then you can add an auxiliary parameter "path = /mnt/tank/homes/%U".
 

wsmith

Cadet
Joined
Jan 1, 2020
Messages
2
Thanks for the reply, anodos!

Here's the thing; samba is mapping the homes partition to /mnt/tank/wsmith, as that is also where my entry in /etc/passwd points. This causes one problem; the home directory exported by 'homes' is actually owned by 'wsmith', and not 'DOMAIN\wsmith' (I created the unix user first).

An alternative solution would be to enable me to log in via ssh/nfs/etc as my DOMAIN\wsmith account. On linux that capability is generally provided by sssd, but I'm completely at a loss for how to do that under FreeNAS on FreeBSD.

-Warren
 
Top