1

I have two computer I wish to work to create websites, one is an imac with osx 10.13.14 and the other is a ubuntu 16.04 that I use as server with Apache. I need to be able to edit files in both machines since the ubuntu one is a laptop and I bring it with me when I go to the office and with the other I work at home. I put my php files in a storage website (Mega) and so I have them synchronized in both machines. Everything works pretty well but if I edit a file on the mac after saving it and synchronize through Mega with the server the server don't include the updated pages giving me a permission denied error. I use same user/owner and group on both machines so I thought it should work but it's not. Is there a way to solve the permission problem and keep working in this way or should I create an ftp server in the ubuntu computer?

OSX ls -la

-rw-rw-r--    1 ezabba  www-data   28265 30 Apr 12:42 funzioni_calendario.php
-rw-rw-r--    1 ezabba  www-data   26401 23 Apr 11:09 funzioni_calendario_.php
-rw-rw-r--    1 ezabba  www-data   28264 30 Apr 12:40 funzioni_calendario_boh.php
-rw-rw-r--    1 ezabba  www-data   25586 26 Apr 10:34 funzioni_calendario_com.php
-rw-rw-r--    1 ezabba  www-data   24321  8 Dic 18:26 funzioni_calendario_ok.php
-rw-rw-r--    1 ezabba  www-data   22905  8 Dic 18:26 funzioni_calendario_orig.php

Ubuntu ls -la

-rw-rw-r--   1 ezabba www-data  28264 apr 30 12:40 funzioni_calendario_boh.php
-rw-rw-r--   1 ezabba www-data  25586 apr 26 10:34 funzioni_calendario_com.php
-rw-rw-r--   1 ezabba www-data  24321 dic  8 18:26 funzioni_calendario_ok.php
-rw-rw-r--   1 ezabba www-data  22905 dic  8 18:26 funzioni_calendario_orig.php
-rw-rw-r--   1 ezabba www-data  26401 apr 23 11:09 funzioni_calendario_.php
-rw-rw-r--   1 ezabba www-data  28265 apr 30 12:42 funzioni_calendario.php
  • I've never used Mega before, but some sync software bases on user ids rather than on user names. You say the user names are the same between the two computers, but have you also matched the user ids when creating the users? – Stephen Ostermiller Apr 30 '18 at 12:24
  • It would also be helpful to get a directory listing using ls -la in the directories on both machines. Please edit the question to add that. – Stephen Ostermiller Apr 30 '18 at 12:25
  • Thanks Stephen, I use the same user for Mega in both computers so same id, and just edited the question with the two ls – luzzuc Apr 30 '18 at 13:46
  • And what are the ids for the users on both systems? You can find that out with grep ezabba /etc/passwd – Stephen Ostermiller Apr 30 '18 at 15:16
  • Apparently the problem is that when the file get synchronized it loses the group permissions, the file in the server just have permissions setted for the owner – luzzuc Apr 30 '18 at 17:17
1

It seems that the passage of a file through Mega makes it lose the group permissions and so in the server the www-data (the apache one) group doesn't have any permission and the pages just don't work.

I haven't found a real solution to this problem but I changed the appoach to the problem itself and, since I use vim to edit files, I switched the editing of the pages using a ssh connection with the server, in this way I can edit the pages from the Mac in Ubuntu without any permission problem.

  • why not change the owner of the files to suit using chown user:user file.php – Steve May 1 '18 at 12:31
  • because everytime I save a file in the client it lose the group permission on the server and so everytime I should go to the server and change permissions that is pretty annoying. – luzzuc May 3 '18 at 15:11

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.