Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
203 views
in Technique[技术] by (71.8m points)

php - Restrict Index File In Machine

I have a question about file permission in linux .

Let's suppose I have hosted a index.php file in my machine. The file can be read in browser.But I wanted to make it such like it should be viewable in browser but should not accessible from my machine. Is there any way so I can restrict someone to access it from my machine folder but can be read via browser?

P.S:- He/She has a low privileged shell.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The webserver runs as some user, for example apache. Make the file owned by apache with permission 600. This makes it available to user apache and no-one else.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...