I have set up a server (A) with a user that allows ssh access from another somewhat (but not fully) trusted server (B). Server B will be sending over files to Server A into a directory that is accessible from the web.
This folder is owned by the user that ssh uses to connect and the group for the directory is Apache.
This is all working fine but I am wondering what is the best way to prevent the directory containing files from Server B from running any executables or PHP/CGI scripts.
I could draw up a white list of file types if that would help. The files will mostly be images but will also include other files such as mp3's, PDF's and other day to day consumer file types.