I am on centos 6.5.
I have a limited user. I gave the user some specific rights via sudoers.
Lets say its user1. I want user1 to create a file in a directory where he has ownership.
Therefore I run
sudo touch test.txt
Now test.txt is created with ownership root:root.
Is there a way that I can force text.txt to be created with ownership user1:user1?
Note that user1 cannot run chown. I do not want user1 to be able to chown either. User1 is an exposed user.
Note 2:
Also note that I am running these command via php (phpseclib) and authenticating via public/private key.
Thanks