1

I've setup Wordpress, however Wordpress is unable to make changes within folders, and after some research it was determined that this is a permissions issue; the user used by Wordpress, is unable to make changes to the folder structure.

How can I identify the user used by Wordpress and how I could provide this user with root access?

  • 4
    Whatever you do, do not give that user root access. Never, ever run that sort of massive web framework under a privileged account, that's complete madness. Only give it the minimum rights on the most limited set of things necessary to work. Unless you find that having your server hijacked is fun, of course. – Mat May 10 '15 at 16:27
  • Furthermore, give it write permissions only to the folders and files it really needs to write to. WordPress is the subject of many automated attacks so the smaller the attack surface the less likely you will get your site taken over – roaima May 10 '15 at 18:47
1

The Wordpress user is the user running the webserver (apache, apache2, httpd, etc). Do a ps -ef | grep apache or ps -ef | grep http .

1

Don't give that user root access as pointed out by Mat.

Instead, give them write permission to the relevant directory hierarchy.

Use ps as dr01 mentioned to find the user. If the webserver runs in a multi-user environment with php wrappers, that won't necessarily be the same user under which Wordpress runs, though. In such cases you could run a script in the webserver like

<?php passthru('whoami'); ?>

to print the username, or if the server can't run commands, something like:

<?php file_put_contents('/tmp/test', 'dummy'); ?>

will create a /tmp/test file with relevant owner (just do a ls -l /tmp/test).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.