Page 1 of 1
Permissions Problem
Posted: 2008-02-15T07:06:58-07:00
by MSR
Hi,
I'm using IM to generate thumbnails which works great except when the files are created the owner is set to root with only owner write permissions. This means that if I want to modify the files later with PHP I am unable to do so.
Is it possible to get IM to set different permissions or do I need to control it elsewhere?
Thanks for your help.
Re: Permissions Problem
Posted: 2008-02-19T11:00:16-07:00
by MSR
I could really do with some help on this if anyone has any to give.
Thanks!
Re: Permissions Problem
Posted: 2008-02-20T18:16:58-07:00
by anthony
If the files create is owned by root, you were root at the the time you created them.
either chown and chmod the files to the right user/permission after running the convert command, or run the convert command as the user the PHP uses using su. You are root so BOTH methods will work fine.
If you are not root, the chown and su may not work. However a sudo can be created to allow you to run commands as another user without needing the password of that user. This however needs to be setup by the superuser.
I for example have used sudo to run backup programs as the backup used from my normal user account on systems that I administer. This lets me write scripts to coordinate between various actions requiring access to many users, but without giving the script (or possible hacker) any access to root at all.
That is the point of sudo. Allow secure access to commands that you normally can not access, in a controled way (with or without a password check).
None of this however is IM specific!!!!
Re: Permissions Problem
Posted: 2008-02-21T05:49:41-07:00
by MSR
Many thanks for your explaination. The problem turned out to be that I was running my commands under sudo and now I've got rid of it my files are saved with nobody ownership - exactly what I want!
Thank you!
Re: Permissions Problem
Posted: 2008-02-21T18:02:09-07:00
by anthony
sudo can run as a user that is different to root. Just use a flag
sudo -u user_to_run_as command args