Web Hosting Talk







View Full Version : A Question of Permission ?


just1post
01-04-2002, 06:10 PM
I've seen all these php scripts which are used e.g. for admin control panels. I was wondering if it is possible to write a perl script to modify files above the /web/ dir ? What permissions would you give this script, 777 ? Also, would I need to change the permissions of the "/web" and "/cgi-bin" directorys to 777 too ?

If this is possible, what would stop a client of mine making the same perl script and changing vital files to the server ? Is this what a hacker would do ?

Sorry, but I really new to this and just HAVE to ask these question's.

Lawrence
01-04-2002, 10:14 PM
If your server is set up right, you couldn't do that. 777 means that the particular script can be executed, written to and read by anyone - not that it can execute, write and read anything it likes. As long as the permissions on files above the /web/ directory will not allow the script to do anything to them, you should be fine. Perl/CGI scripts either run under the user's ID or as Nobody, so it's just a matter of not letting these usernames/groups be allowed to touch any files you don't want them to.

If the script was running using setuid as root, it could do whatever it pleases. But that's not something it can "just do", the server administrator is the only one who can give it permission to do that. I'm not familiar with the details, as I haven't had to use it much.