The source code of my website is on a server multiple people can access via FTP.

How can I prevent them from accessing the source code?


Ok, so I can't do nothing about that. But, how about if I can compress the script and to change with the original on FTP? (of course in my PC will not be compressed the code). But how can I compress all the codes if I have for example like this:

<div class="col-xs-6 text-center">
<a href="<?php echo Config::$_PAGE_URL; ?>complaints">General complaints</a>
  if(isset($_SESSION['userID'])) {
    $data = 1;?>
       <a href="<?php echo Config::$_PAGE_URL; ?>mycomplaints">My complaints</a> <?php
function showpictures(x, y) {
    var token_id = '<?php echo config::$GeneralToken ?>';
    swal('Coords','<img src = "'+page_url+'maps?x='+x+'&y='+y+'" height = "420px"></img>','')

.swal2-popup {
  font-size: 1.5rem !important;

If I can compress, can I compress all in or should I compress them separately (html, php, js)?

  • 2
    You need to configure different users with different rights on files/directories. – Xavier59 Sep 3 at 17:35
  • They are with $$, and I'm with the scripting. And probably they want to have acces on their FTP. Here is the problem, I don't want for them to have my original files with source of the website/pages. Is there a way to crypt some files like that? All the acces (configure different users rights on files/directories) is given to another friend, and so lets say that he will change the rights on files, but IF he when i'm offline, change back the rights on files and stole my files, what should I do then? So that's way I need to do something, crypt or idk. – Destroyed Sep 3 at 17:55
  • Just don't do it. – Tryna Learn Somethin Sep 3 at 17:57
  • 1
    Spaghetti code would be the most inefficient option here, it is recommended to protect it with some license. – tungsten Sep 3 at 18:04
  • You can only obfuscate the file, and it can always be deobfuscated. So no, short answer, "crypting" the file is not possible. – Xavier59 Sep 3 at 18:15

That depends entirely on the way the permissions of the server are set up.

For example, the FTP server can be configured so that different users have access to different directories. You could, for instance, only allow the user dev to access /var/www, while the user otherguy only has access to /home/otherguy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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