Connect with us

Google Cloud

[SOLVED] Fix FTP Permission Errors on Google Cloud (VM instances)

Nitesh Arya

Published

on

[SOLVED] How to Fix SFTP Permission Errors on Google Cloud

Hey friends if you are facing problems or errors while editing , uploading and deleting your files of Google Cloud Platform by using FTP software (Like: FileZilla) then this is for you. In this tutorial we going to fix that problem so let’s start.
[SOLVED] How to Fix SFTP Permission Errors on Google Cloud

How to Fix FTP Permission denied – File transfer failed Errors on Google Cloud Platform

 

Things You Have to Do

  1. Identify The Error
  2. Connect to VM Instance
  3. Check File / Folder Permissions
  4. Set File / Folder Permissions
  5. Restart Apache
  6. Retry to Edit or Upload File
  7. Done!

1. Identify The Error

What types of Error is showing in FTP?


In the image above you can see, the user is attempting to download wp-config.php file in their website’s in htdocs folder via FTP (FileZilla).
Permission denied – File transfer failed  This Problem is occurring because the user does not have the required permissions to create new file, change or edit to folder htdocs

 

2. Connect to VM Instance

In order to fix the problem, you have to edit the file’s permissions in Google Cloud Platform using the SSH (Linux Shell) terminal.


Go to your Compute Engine, then to VM instances to access your VM instance.


Click on the SSH button to connect to your website via SSH.

 

3. Check File / Folder Permissions

Now if are connected to your website via SSH, the first thing you have to do check the permissions of the file you want to edit.  See the example, checking the permissions of the htdocs (here is wp-config.php file and all wordpress file, its also a main folder of website) folder.

To do this, execute the following command:

stat -c "%a %n" /path/to/file


In the above image you can see the command stat -c “%a %n” /opt/bitnami/apps/wordpress/htdocs is used to check the permissions of the htdocs folder.

As you can see the file’s permissions are set to 644 

So that was a reason of Permission denied errors and File transfer failed errors, in order to fix the problem we have to set folder permission 644 to 777 so let’s see.

 

4. Set File / Folder Permissions

In Order to set folder or file permission 644 to 777 you have use this command

sudo chmod 777 /path/to/file


In the above image you can see the command sudo chmod 777 /opt/bitnami/apps/wordpress/htdocs is used to set folder or file permission 644 to 777

 

5. Restart Apache

Now its time to Restart Apache because without restart, changes will not take any affect
For most Apache configurations, run the following restart command:

sudo service apache2 graceful

For Bitnami Apache configurations, run the following restart command:

sudo /opt/bitnami/ctlscript.sh restart apache

 

6. Retry File Upload

So now the file/folder has permissions of 777, we will be able to upload/ edit/ download any files from htdocs

Bingo! We got it, the image above you can see, we have the wp-config.php file downloaded successfully from the server via FTP after changing the file’s permissions from 644 to 777.

Thnks…. Hope you liked, plz give comment.

Continue Reading
6 Comments

6 Comments

  1. Nitesh Arya

    October 10, 2018 at 11:05 am

    If You need any help leave comment

  2. Nitesh Arya

    October 10, 2018 at 11:05 am

    nic

  3. Sudhir Bhai

    October 10, 2018 at 11:05 am

    Nic thnks very much

  4. Nitesh Arya

    Nitesh Arya

    October 9, 2018 at 5:34 pm

    If You need any help leave comment

  5. Nitesh Arya

    Nitesh Arya

    October 9, 2018 at 6:49 pm

    nic

  6. Sudhir Bhai

    October 9, 2018 at 6:57 pm

    Nic thnks very much

Leave a Reply

Your email address will not be published. Required fields are marked *

Trending

.