qwertymodo
Contributor
- Joined
- Apr 7, 2014
- Messages
- 144
I recently added a bunch of jail service accounts to the FreeNAS host in order to more easily track which services were doing what (and also to aid in the ease of managing permissions on mount points), but it got really annoying to see all of those users/groups listed in the drop-down tree menu as if they were real users, so I dug around and figured out how FreeNAS differentiates between built-in user accounts, which only show up in the list when you click "View Users/View Groups" but don't get their own entry in the main navigation tree menu.
First, create the user normally using the GUI. If you're trying to mirror an existing account in a jail, be sure to specify the correct UID (e.g. UID 817 for the btsync plugin's service account). Select Create a New Primary Group for the user, set the home directory to /nonexistent and the shell to nologin and select disable password login.
Now, to flag the account as a built-in, open the settings db in SQLite (to be safe, you might want to make a backup of /data/freenas-v1.db first)
and execute the following commands (be sure to substitute the correct UID/GID)
and one last one that's probably optional, but it is consistent with the actual system built-in accounts
and quit
Reload the GUI, and here is the end result:
First, create the user normally using the GUI. If you're trying to mirror an existing account in a jail, be sure to specify the correct UID (e.g. UID 817 for the btsync plugin's service account). Select Create a New Primary Group for the user, set the home directory to /nonexistent and the shell to nologin and select disable password login.
Now, to flag the account as a built-in, open the settings db in SQLite (to be safe, you might want to make a backup of /data/freenas-v1.db first)
Code:
sqlite3 /data/freenas-v1.db
and execute the following commands (be sure to substitute the correct UID/GID)
Code:
sqlite> UPDATE account_bsdusers SET bsdusr_builtin='1' WHERE bsdusr_uid='youruidhere'; sqlite> UPDATE account_bsdgroups SET bsdgrp_builtin='1' WHERE bsdgrp_gid='yourgidhere';
and one last one that's probably optional, but it is consistent with the actual system built-in accounts
Code:
sqlite> UPDATE account_bsdusers SET bsdusr_smbhash='*' WHERE bsdusr_uid='youruidhere';
and quit
Code:
sqlite> .q
Reload the GUI, and here is the end result:

Last edited: