How to change file ownership properly in jail by a script?

Status
Not open for further replies.

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
I am running transmission in a jail and would like to have the resulting downloaded files to have a different owner than the transmission user.

I know that I can run transmission as a different user by adding transmission_user and transmission_group to the jail's rc.conf, but then I have one user owning all of the files. I want to be able to assign different file owners per script.

What is the proper way to do this? For file ownership to change, the script would need to use sudo or run as root. I am hesitating because sudo is not even a part of the jail environment, I fear glaring security issues if I just install sudo or run the script with suid as root.
 
Last edited:

garm

Wizard
Joined
Aug 19, 2017
Messages
1,556
You script chown and run that as root in jail, but why would you?

Use groups, that’s what they’re are for. Users is for telling you who created a file and groups are for managing access.
 
Status
Not open for further replies.
Top