Secure file upload using chmod 755

Hello!

Today I will talk about secure file upload.

Please, do not use chmod 777 on yours upload files. That means everyone can write on your directory and maybe execute that file.

Use chmod 755 and be happy. For that you must have to change the directory’s owner to the apache users. In the Ubuntu Linux the apache user is usually www-data, but using another versions can be apache, httpd, nobody or just www.

So…

chown -R www-data upload_dir  
chown -R 755 upload_dir

See you…

Published by

Junior Grossi

senior software engineer & stutterer conference speaker. happy husband & dad. maintains Corcel PHP, elePHPant.me and PHPMG. Engineering Manager @ Paddle

Leave a Reply

Your email address will not be published. Required fields are marked *