Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am developing a site in PHP on Linux Server where I need to download a file from Windows Server to Linux Machine. I can do it with Some Changes in SeLinux or setting some properties on it, i.e.:

% setsebool -P httpd_disable_trans=1

But our client refuses to compromise any security for this functionality. So we need to find any other workarounds. What else can we do?

share|improve this question
How do you intend to download the file? What method will you use? – Matthew Ife Mar 29 '13 at 14:19
Right. You need to know (and tell us) how you are fetching this file. – Michael Hampton Mar 29 '13 at 16:38
Refuses to compromise any security and runs a PHP application might be mutually exclusive. – davey Mar 30 '13 at 9:03
i used code below if (ftp_get($conn_id, $local_file, $remote_file, FTP_BINARY)) { echo "successfully written to $local_file\n"; } else { echo "Not Downloaded"; } – Supriya Apr 1 '13 at 4:18

Maybe they will accept a policy extension for SELinux to allow the web server to do certain kinds of operations against a particular file or directory. To create a custom policy there is a tool called audit2allow which can help you generate the policy you need. There is an example of creating a custom SELinux policy module at:

If you do this make sure the process is well documented because it's the kind of thing that can get broken on a new deployment or on an update and you want to make sure it's not missed during those kinds of activities.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.