In ubuntu I have the /var/www/wordpress
folder owned by a user. In order to update/upgrade wordpress some folders need to be owned by www-data
.
I am kind of confused but from what I've read that may pose a security risk. So I keep all the files owned by the user and when I need to update, I log to ssh (using pubkey), do a chown -R www-data /var/www/wordpress
and after update I chown -R user:user /var/www/wordpress
.
The trouble is that I cannot auto-update wordpress and have to do all this manually.
I found about Enabling SSH Upgrade Access and can't figure out if this is safe security wise. Giving wordpress access to public and privatekey would compromise it?
define( 'FTP_PUBKEY', '/home/username/.ssh/id_rsa.pub' );
define( 'FTP_PRIKEY', '/home/username/.ssh/id_rsa' );