I have apache web server, linux, ssh access with sudo. And many troubles with editing, uploading, pushing, committing there. Because there are set 755 for dirs, 644 for files, and apache:apache owner

Question: how to upload, push with such permissions or with smallest changes of config. May be using extra soft will be helpful.

Current work process; 1. changing rights/owners 2. making file operations 3. changing rights/owners back or 1. making file operations directly via bash with sudo 2. setting correct rights/owners

  • from stackoverflow user: first for upload a in zip or tar, you can use scp, correct syntax scp -r foo your_username@remotehost.edu:/some/remote/directory. later of upload for make permission for a certain user you can use su "username" for unzip or tar, with this you make the files with correct permission to user. the same permission that you have before, apply to new files with this user or use git, with git you can clone your repository o code with the correct permission for files with any user, i recommend use bitbucket for this – user3456655 May 18 '18 at 18:07
  • server is located at intranet (not internet) your approach is better than editing 1 by 1 file. But there are still a lot of handwork: writing 1 simple script i save/upload file about 20-30 times. ...... i will try it, but still looking for an automated solution – user3456655 May 18 '18 at 18:08

Your Answer

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

Browse other questions tagged or ask your own question.