I am using wordpress with google cloud and set it up for sftp connection. The permission to folders are 755 and files are 644. Even i have changed Cloud API access scopes to "allow full connection".
When i try to add plugin through wordpress backend it will ask me for ftp credentials unless i change to sudo chown -Rf www-data.www-data /var/www/html
but then i can't upload or change any file through sftp unless i change sudo chown -R [my-user-name]:www-data /var/www/html
.
So i have to change permissions every time i change something either through sftp or through backend.