media user issues (duplicate entry, wrong uid/gid)

Description

tl;dr How do I change the media user uid/gid?

Years ago I created a "media" group. Then FreeNAS created one and, I think, appropriately used the existing group if present. Then at some point a "media" user was created. Cut to today when I notice that I have two "media" groups (my original GID and the FreeNAS version) and a "media" user created by FreeNAS/TrueNAS.

I don't know exactly when the different users and groups were created, but I noticed this after rebooting in to 12-U5.1

I have other machines on the network that use the UID and GID that I created and I'd like to resolve this by modifying the TrueNAS entry. Plus, it seems less than ideal that I have two "media" group entries.

I can probably just delete the group that I created, but that still leaves me with the wrong UID and GID.

I note that I can't change this in the WebUI or using a middleware command:

$ sudo midclt call 'group.query' '[["gid","=",8675309]]'

[{"id": 50, "gid": 8675309, "group": "media", "builtin": true, "sudo": false, "sudo_nopasswd": false, "sudo_commands": [], "smb": false, "users": [32], "local": true, "id_type_both": false}]

$ sudo midclt call user.update 50 '{"uid": "63342"}'

[EINVAL] user_update.uid: This attribute cannot be changed

I did locate the entries in /data/freenas-v1.db and I can figure out the sql syntax to update those, but I'm hesitant to do so without understanding the consequences. Or knowing any further steps to get the system back in sync.

Should I also edit /etc/passwd and /etc/group?

Should I immediately reboot?

Would I be better off with some startup script that modifies everything (what is everything?) on each boot?

I understand some of this is my "issue" (wanting the IDs to match) and some is a bug (the duplicate group that was created). Though even the bug might be an edge case that isn't worth handling and is best left educating me how to handle it and what to look out for.

I suppose worst case I end up just modifying permissions by number and mapping those in my head, but that's certainly less than ideal.

Thanks for your help.

Problem/Justification

None

Impact

None

Activity

Show:

Jacob Block November 4, 2021 at 12:26 AM
Edited

FYI, the aforementioned PR caused ssh keys to be rejected for media user and NFS shares using mapall user and group of media:media to be associated with the built-in instead of the renamed media_1:media_1. Fortunately no impact on actual file permissions.

Bug Clerk September 14, 2021 at 3:04 PM

Arno Hautala September 14, 2021 at 1:26 PM

Arno Hautala September 14, 2021 at 1:07 PM

It looks to me like this PR is going to revert my (admittedly hacked) fix and force me to use the UID/GID that TrueNAS wants. I suppose I can open another ticket requesting to be able to change the builtin UID/GID.

Bug Clerk September 14, 2021 at 12:50 PM

Complete

Details

Assignee

Reporter

Labels

Impact

Medium

Components

Affects versions

Priority

More fields

Katalon Platform

Created August 27, 2021 at 1:57 PM
Updated July 6, 2022 at 8:58 PM
Resolved September 14, 2021 at 4:15 PM