Forum Moderators: phranque

Message Too Old, No Replies

Security of database connection data

         

Larryfox

12:34 pm on Apr 13, 2022 (gmt 0)

Top Contributors Of The Month



My website is hosted on a shared host. I currently have my database connection info in a folder one level above public_html. What is the best method to prevent access to this folder?

not2easy

1:30 pm on Apr 13, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



You can change the settings for folder permissions (chmod). There are several older discussions about using chmod here: [webmasterworld.com...]

Or there's wikipedia: https://en.wikipedia.org/wiki/Chmod

Larryfox

2:32 pm on Apr 13, 2022 (gmt 0)

Top Contributors Of The Month



Thanks for the reply and link. I changed permissions for that folder to 740.

phranque

7:41 pm on Apr 13, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



permissions work in concert with ownership.

you can change ownership of an inode (file/directory/etc) using the chown command.

Larryfox

8:03 pm on Apr 13, 2022 (gmt 0)

Top Contributors Of The Month



Thanks again. I already own all files

phranque

8:38 pm on Apr 13, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



740 means anyone in the group also has read access.