Summary
There is currently no programmatic way to create Unraid users that the web GUI recognises without a reboot. The GraphQL API at /graphql exposes read-only user queries (me, UserAccount) but has no mutations for creating, updating, or deleting users.
This is a feature request to add user management mutations (createUser, updateUser, deleteUser) to the GraphQL API.
Use Case
Automating user provisioning for homelab RBAC — creating users with specified UIDs/GIDs, group memberships, and share permissions at boot time without manual GUI interaction. This is essential for infrastructure-as-code workflows where user/permission state should be declarative and reproducible.
What Was Tested (Unraid 7.2.2)
Every available method for programmatic user creation was exhaustively tested. None produce a GUI-visible user without a reboot:
| Method |
User Created? |
Visible in GUI? |
Notes |
| GUI (Add User) |
Yes |
Yes |
Works perfectly — the baseline |
useradd + config file writes |
Yes |
After reboot only |
System/SMB access works immediately, but GUI doesn't see the user until reboot |
emcmd cmdUserEdit=Add |
No (hangs) |
N/A |
Blocks indefinitely; no useradd entry in syslog. Interestingly, cmdUserEdit=Delete does work |
| Direct socket write to emhttpd |
No |
N/A |
HTTP 500 or timeout |
curl via nginx with session cookie |
No (502) |
N/A |
nginx times out waiting for emhttpd |
Append to users.ini |
N/A |
No |
File is present but GUI ignores it until reboot |
| GraphQL API |
No (no mutation exists) |
N/A |
addUser, createUser, setUser, updateUser all return "Cannot query field on type Mutation" |
What the GUI Does Internally (syslog observation)
When creating a user through the web GUI, emhttpd executes:
emhttpd: shcmd (137): useradd -g users -d / -s /bin/false -c '' 'testgui'
useradd: new user: name=testgui, UID=2003, GID=100, home=/, shell=/bin/false
chpasswd: password changed for testgui
emhttpd: Restarting services...
emhttpd: shcmd (145): /etc/rc.d/rc.samba reload
emhttpd: shcmd (148): exportfs -ra
emhttpd: shcmd (150): /etc/rc.d/rc.avahidaemon reload
emhttpd: shcmd (155): cp /etc/passwd /etc/shadow /var/lib/samba/private/smbpasswd /boot/config
The key insight: emhttpd manages user creation internally and copies config files from /etc/ to /boot/config/. The GUI user list is populated from these files at boot, and there's no mechanism to trigger a refresh at runtime from outside emhttpd.
What We're Requesting
- GraphQL mutations for user management:
createUser, updateUser, deleteUser — with parameters for username, password, UID (optional), groups, and share permissions
- Real-time GUI refresh: Users created via the API should appear in the GUI immediately without requiring a reboot
- Service reload: The API should handle reloading samba/NFS/avahi after user changes (as the GUI already does internally)
Questions
- Why does
emcmd cmdUserEdit=Delete work from CLI but cmdUserEdit=Add hangs indefinitely?
- Is there a signal or command to force
emhttpd to re-read its user list at runtime?
- Are there plans to expose user management through the API?
Forum Discussion
This was originally posted on the Unraid forums with full technical details:
https://forums.unraid.net/topic/190436-creating-users-from-command-line/
Environment
- Unraid 7.2.2
- Slackware 15.0+, x86_64
Summary
There is currently no programmatic way to create Unraid users that the web GUI recognises without a reboot. The GraphQL API at
/graphqlexposes read-only user queries (me,UserAccount) but has no mutations for creating, updating, or deleting users.This is a feature request to add user management mutations (
createUser,updateUser,deleteUser) to the GraphQL API.Use Case
Automating user provisioning for homelab RBAC — creating users with specified UIDs/GIDs, group memberships, and share permissions at boot time without manual GUI interaction. This is essential for infrastructure-as-code workflows where user/permission state should be declarative and reproducible.
What Was Tested (Unraid 7.2.2)
Every available method for programmatic user creation was exhaustively tested. None produce a GUI-visible user without a reboot:
useradd+ config file writesemcmd cmdUserEdit=Adduseraddentry in syslog. Interestingly,cmdUserEdit=Deletedoes workcurlvia nginx with session cookieusers.iniaddUser,createUser,setUser,updateUserall return "Cannot query field on type Mutation"What the GUI Does Internally (syslog observation)
When creating a user through the web GUI,
emhttpdexecutes:The key insight:
emhttpdmanages user creation internally and copies config files from/etc/to/boot/config/. The GUI user list is populated from these files at boot, and there's no mechanism to trigger a refresh at runtime from outsideemhttpd.What We're Requesting
createUser,updateUser,deleteUser— with parameters for username, password, UID (optional), groups, and share permissionsQuestions
emcmd cmdUserEdit=Deletework from CLI butcmdUserEdit=Addhangs indefinitely?emhttpdto re-read its user list at runtime?Forum Discussion
This was originally posted on the Unraid forums with full technical details:
https://forums.unraid.net/topic/190436-creating-users-from-command-line/
Environment