How to Fix FTP Permission Errors on Google Cloud

First, Give permission to the admin in GCP. 
http://jobinandjismi.in/how-to-add-permissions-for-the-user-in-iam-in-gcp/

Basically, we need to follow 6 steps to rectify the issue. They are: 

  1. Identify Error

Permission denied errors occur when you don’t have the required permissions to make changes to a file that you’re trying to edit over FTP.

2. Connect to VM Instance
To fix the problem, you will need to edit the file’s permissions in Google Cloud Platform. This requires you to connect to your VM instance using the SSH (Linux Shell) terminal.For that: Go to your Google Cloud homepage and click the hamburger menu in the upper left-hand corner→ Compute EngineVM instancesSSH button to connect to your website via SSH.

3. Check File Permissions
Now that you’ve connected to your website via SSH, the first step is to check the permissions of the file you want to edit. In this example, the user would be checking the permissions of the corresponding file/folder file. To do this, execute the following command: stat -c “%a %n” /path/to/file.

4. Edit File Permissions
Because the file’s permissions are set to 644, you would not have sufficient permissions to edit the file via FTP. To fix this problem, you are going to change the file’s permissions from 644 to 777, thereby granting all permissions.To do this, run the following command: sudo chmod 777 /path/to/file 

5. Restart Apache
For changes to take effect, you will need to restart your Apache server. 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
Now that the file has permissions of 777, you will be able to upload it to your server successfully via FTP.

Leave a comment

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