Is it possible for someone to read or write my .php files on the server if they have read / write permissions in the world?

Can someone steal or modify my PHP files if I installed them in chmod 777?

I have an EC-2 instance, and even when I am registered as an EC2 user, I cannot change my file if I installed them in chmod 755. I can only make changes to the file when I installed them in chmod 777.

+3
source share
4 answers

Yes and no. Can anyone view files over the network? No. However, anyone with the ability to log into your computer can modify the files (since they are read / write in the world). Overall, this is not a good practice. I would advise against allowing more than 775. If you are in a hosted environment this should not be a problem.

+4
source

Actually, everything here is incorrect, 755 for the file is very wrong.

This means that the owner is reading / writing / executing. read / execute by the group and everyone else.

Directories should be 755, because the execution bit in the directory means that the user can list its contents, since you obviously cannot execute the directory.

-, , php.

, , 755, (rwx, rx, rx), 644 (rw, r, r).

, .

- PHP

  • apache ( )
  • CGI jail/chroot ( , , , )
  • SuExec suPHP (php -)

(1), 664 755 .

/chroot (2), , , 664 755, .

suExec suPHP, php 640 750, . 600 700, apache ( ), , , , -.

+3

/ , /. chmod 777 ( ).

, , , -, , , .

+1


.htacces yeah:)
chmod 777?

UPDATE
?
wget http://xxx.xxx/update.php~

0

All Articles