{"id":6468,"date":"2021-06-03T09:48:30","date_gmt":"2021-06-03T04:18:30","guid":{"rendered":"https:\/\/www.skynats.com\/?p=6468"},"modified":"2021-11-02T16:28:07","modified_gmt":"2021-11-02T10:58:07","slug":"how-to-fix-the-ftp-permission-denied-error-in-google-cloud-platform","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/how-to-fix-the-ftp-permission-denied-error-in-google-cloud-platform\/","title":{"rendered":"How to Fix FTP Permission denied error in Google Cloud Platform"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Some of the users getting this &#8220;permission denied error&#8221; while trying to connect the Google Cloud files via FTP. Our <a href=\"https:\/\/www.skynats.com\/google-cloud-management\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"color:#026e9c\" class=\"has-inline-color\">Google cloud support<\/span><\/a><span style=\"color:#046d9b\" class=\"has-inline-color\"> <\/span>team will be available to assist you with any issues in Google Cloud Platform.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. Identifying the Error<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This permission denied error occurs when you trying to edit a file in GCP by using FTP. When you try to edit the file, you will see an error as below<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"has-inline-color has-accent-color\">Error: \/etc\/apache2\/sites-available\/wordpress.conf: open for write: permission denied\/\nError: File transfer failed<\/span><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The user getting permission denied error due to insufficient permission to edit the file wordpresss.conf file in GCP.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. Connecting to VM Instance<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To fix this insufficient permission issue you need to edit the file&#8217;s permission in Google Cloud. For this first you have to connect the VM instance via SSH terminal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can connect a VM instance in GCP by <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>GCP --&gt; Compute Engine --&gt; VM Instances --&gt; you can see SSH option in the right side of the instance section.<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Just click on SSH button to connect the instance via SSH terminal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. Check For File Permissions<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In order to check the file permissions for the user run the below command in the terminal <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>stat -c \"%a %n\" \/path to the file<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In this scenario our file location is \/etc\/apache2\/sites-available\/wordpress.conf. So the command will be <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>stat -c \"%a %n\" \/etc\/apache2\/sites-available\/wordpress.conf<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"928\" height=\"123\" src=\"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2021\/06\/wordpresss.conf-file-pwermission-for-blog.png\" alt=\"\" class=\"wp-image-6471\" srcset=\"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2021\/06\/wordpresss.conf-file-pwermission-for-blog.png 928w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2021\/06\/wordpresss.conf-file-pwermission-for-blog-300x40.png 300w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2021\/06\/wordpresss.conf-file-pwermission-for-blog-768x102.png 768w\" sizes=\"(max-width: 928px) 100vw, 928px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We can see that the output for this command from the above image that the permission for the file is set to be 644, due to this lack of permission the user got the permission denied error when tried to edit the file using FTP.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4. Changing the File Permission<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In order to edit the file by the user, you need to change the file permission from 644 to 777. So that we can edit the file via FTP. To change the file permission to 777 run the below command in the terminal <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod 777 \/etc\/apache2\/sites-available\/wordpress.conf<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And finally restart the Apache service by running the below command <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo service apache2 restart<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For the users who are using the Bitnami Apache servers, you can use the below command <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo \/opt\/bitnami\/ctlscript.sh restart apache<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Connect the FTP client again and retry to edit the file, now you will be able to edit the file successfully via FTP.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Kindly note, providing 777 full permission to a file is not recommended as it may have chances for security breach. So we recommend to use a edit the system files via SSH terminal itself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you need any assistance in editing files or making any changes in Google cloud instances, our<span style=\"color:#036e9c\" class=\"has-inline-color\"> <\/span><a href=\"https:\/\/www.skynats.com\/contact-us\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"color:#02628b\" class=\"has-inline-color\">technical team<\/span><\/a><span style=\"color:#036f9e\" class=\"has-inline-color\"> <\/span>will be available anytime.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some of the users getting this &#8220;permission denied error&#8221; while trying to connect the Google Cloud files via FTP. Our Google cloud support team will be available to assist you with any issues in Google Cloud Platform. 1. Identifying the Error This permission denied error occurs when you trying to edit a file in GCP [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,376],"tags":[377,378],"class_list":["post-6468","post","type-post","status-publish","format-standard","hentry","category-blog","category-google-cloud-management","tag-fix-ftp-error","tag-fix-permission-denied-error"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/6468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=6468"}],"version-history":[{"count":0,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/6468\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=6468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=6468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=6468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}