Default User in Jails (Permissions)

ere109

Contributor
Joined
Aug 22, 2017
Messages
190
I've recently created a few jails using the new iocage plugin manager. Among them is Deluge. I've got it running and have created a mount point - except that I'm struggling with permissions (files can be read, but not write). After reading the Guide, I see that I need to give the mounted dataset permission for the Deluge default user, but I can't find that username in any of my searches. Is it always as simple as the name of the program - deluge - or is it attached to the UUID?
Searching the jail, I don't see a "deluge" user. These are my available users:
Code:
root:*:0:0:
toor:*:0:0:
daemon:*:1:1:
operator:*:2:5:
bin:*:3:7:
tty:*:4:65533:
kmem:*:5:65533:
games:*:7:13:
news:*:8:8:
man:*:9:9:
sshd:*:22:22:
smmsp:*:25:25:
mailnull:*:26:26:
bind:*:53:53:
unbound:*:59:59:
proxy:*:62:62:
_pflogd:*:64:64:
_dhcp:*:65:65:
uucp:*:66:66:
auditdistd:*:78:77:
www:*:80:80:
_ypldap:*:160:160:
hast:*:845:845:
nobody:*:65534:65534:


If there's a really handy/simple trick to this, please enlighten me. If the answer is really complicated, I'd still love to know.

Thank you
 

scrappy

Patron
Joined
Mar 16, 2017
Messages
347
In your jail type the command id deluge and take note of your UID and GID of deluge. Now in FreeNAS create a group named deluge with the GID noted earlier. Save it and create user deluge with the UID of deluge from your jail making sure it is also given the deluge group name from earlier for its primary group. You can disable user password login, have nologin as shell, and set home directory as nonexistent. All you have to do from here is change the dataset or directory you have setup for deluge. I'd recommend having a dataset/directory only intended for deluge since deluge user & group will own that dataset/directory. If you want, you can add the deluge group to your own user's auxiliary group as well. This is how I would go about doing what you're trying to do.
 

ere109

Contributor
Joined
Aug 22, 2017
Messages
190
Thank you @scrappy . Unfortunately, in the jail there is no deluge user. However, there is the daemon user, who has the same uid as daemon in FreeNAS. Another option might be operator, listed in my jail users above.
 

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,478
I recall that I had to create a user in one my jails (believe it was deluge) because it didn't exist. If you search you will be able to easily find the commands for adding a user and group (and specifying the UID and GID to use) in linux.
 

ere109

Contributor
Joined
Aug 22, 2017
Messages
190
Thanks for that. I've created a "deluge" user in my FN install, and inside the jail using:
Code:
pw useradd -n deluge -u 818 -d /nonexistent -s /usr/sbin/nologin

I've also added myself to the deluge group, so I can still access the data outside the jail. Still a theoretical work in progress.
I'll play around with the plugins manager, next, and update with my findings.
 
Top