When I come to uninstall Wordpress plugins I get a message that I need to login in FTP/SFTP to the system. When I fill the right credentials in, Wordpress rejects them.
After some reading I understood I should make my work-user
owner and www-data
as group (both recursively), to the wp-content
library (in which the plugins, themes, and languages libraries are situated).
Well, I did that, and I also gave 777 recursively to all of wp-contnet, just for testing (basic permissions there are 755 to dirs and 644 to files).
Even after that, I am still being asked by Wordpress to login via FTP/SFTP and again Wordpress rejects the right credentials.
cd /var/www/html/example.com
sudo chown $USER:www-data wp-content/ -R
sudo chmod 777 wp-content/ -R
More details (IPs and Usernames ommited):
sudo tail /var/log/apache2/error.log :
0.0.0.0 - - [08/Dec/2016:10:12:39 +0000] "POST /example.com/wp-admin/admin-ajax.php HTTP/1.1" 200 436 "http://0.0.0.0/example.com/wp-admin/plugins.php"
sudo tail /var/log/auth.log :
Dec 8 10:24:34 ubuntu-2gb-fra1-01 sudo: pam_unix(sudo:session): session closed for user root
Dec 8 10:26:36 ubuntu-2gb-fra1-01 sshd[28358]: Invalid user sunil from IP
Dec 8 10:26:36 ubuntu-2gb-fra1-01 sshd[28358]: input_userauth_request: invalid user sunil [preauth]
Dec 8 10:26:37 ubuntu-2gb-fra1-01 sshd[28358]: Connection closed by IP port 37544 [preauth]
Dec 8 10:30:01 ubuntu-2gb-fra1-01 CRON[28571]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 8 10:30:01 ubuntu-2gb-fra1-01 CRON[28571]: pam_unix(cron:session): session closed for user root
Dec 8 10:33:41 ubuntu-2gb-fra1-01 sshd[28658]: Did not receive identification string from IP
Dec 8 10:34:54 ubuntu-2gb-fra1-01 sshd[28659]: Connection closed by IP port 17928 [preauth]
Dec 8 10:35:26 ubuntu-2gb-fra1-01 SUDO USERNAME TTY=pts/0 ; PWD=/var/log ; USER=root ; COMMAND=/usr/bin/tail auth.log
Update 1 - Update for George:
This time I did the following inside the sites' dir, with my primary Ubuntu work-user:
cd /var/www/html/example.com
sudo chown $USER:www-data wp-content/ -R
sudo find . -type d -exec chmod 755 {} \;
sudo find . -type f -exec chmod 644 {} \;
I went to delete plugins, was asked for the FTP credentials and filled them in (I filled in my same Ubuntu work-user and its password) and still, Wordpress rejects these details and I can't remove plugins from its GUI.
Update 2 - A direction for a solution:
When I first raised up the VPS, I disabled any option to login to the server with passwords. I always login to it with SSH keys (even though I do have a password for my work-user with whom I login). This fact might be associated with the problem I encounter.
In other words, Wordpress wants to use the servers username-passowrd FTP/SFTP authentication but on the other hand, by means of security I disabled password for server authentication when creating the VPS while Wordpress doesn't process SSH keys, so Wordpress kind of shooting itself in the foot with the request for me to login with SFTP (most of the SFTP users I know, including myself, use SFTP at least with SSH keys, but not only with passwords).
wp-content
directory for it to work. If that doesn't work out for you, check the following SO question: stackoverflow.com/questions/17922644/…