1

I'm trying upload the edited apache2.conf but getting File Permission Denied Error.

Status: Starting upload of O:\Users\Circle Radius\SRPL\apache2.conf
Command:    cd "/etc/apache2"
Response:   New directory is: "/etc/apache2"
Command:    put "O:\Users\Circle Radius\SRPL\apache2.conf" "apache2.conf"
Error:  /etc/apache2/apache2.conf: open for write: permission denied
Error:  File transfer failed
  • 2
    Directories /etc and below are owned by root. Are you authenticated with root when upload the config? – Romeo Ninov Apr 24 '17 at 7:31
  • 2
    You need to be root in order to edit or move anything in /etc/ as @RomeoNinov commented above , you could try to upload that config in your home directory first and later try to move using sudo mv – Alok Yadav Apr 24 '17 at 7:33
  • @RomeoNinov I'm accessing it using User - "ubuntu" is there any command which can help me grant the permission for this user so that i can update my apache2.conf directly from FTP – Arpit Mittal Apr 24 '17 at 8:49
  • @ArpitMittal, copy the file to /var/tmp and then via command line move it to the proper place. Do not play with permission in /etc – Romeo Ninov Apr 24 '17 at 8:50
  • @RomeoNinov Thank you so much for you help.. :) – Arpit Mittal Apr 24 '17 at 8:53
1

Based on the communication in comments, it is visible you use account which do not have proper permissions to write in /etc

The better and more secure way to accomplish your task is:

  1. Upload the file (via ordinary user) in /var/tmp
  2. Login to the terminal
  3. Become root: sudo su -
  4. Make a backup of the original file:

    cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_original
    
  5. Copy the new file:

    cp /var/tmp/apache2.conf /etc/apache2/apache2.conf
    
  6. Restart apache

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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