LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-28-2019, 01:11 AM   #1
snehalvolvoikar29
LQ Newbie
 
Registered: Dec 2019
Posts: 2

Rep: Reputation: Disabled
Issue with setting up permissions on my linux server.


Hi..This is Snehal. I have some problem changing permissions for my folders on my server operating in linux. I have my wordpress website on it and when I tried to upload a theme, its giving me the following error " The uploaded file could not be moved to wp-content/uploads."

I think there's some problem with regards to permissions. Currently the 'wp-content' directory has a permission mentioned below.
drwxr-xr-x 5 root root 4096 Dec 28 05:21 wp-content

I'm not familiar with the linux commands and how it works. Please help me with this.
 
Old 12-28-2019, 02:16 AM   #2
berndbausch
LQ Guru
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 5,670

Rep: Reputation: 1701Reputation: 1701Reputation: 1701Reputation: 1701Reputation: 1701Reputation: 1701Reputation: 1701Reputation: 1701Reputation: 1701Reputation: 1701Reputation: 1701
You talk about "my server". Did you set up that server and wordpress? Has the upload ever worked? How do you upload? Also very important: Which distro and which web server are installed?

You will probably find more information about this error in the web server's log files.

The permissions of wp-content show that it is owned by root and only writable by root, which is probably incorrect for web content. It should be owned by the web server, or at least be writable by it.

Now, the upload directory is wp-content/upload. What are the permissions of that directory?
 
1 members found this post helpful.
Old 12-28-2019, 04:04 AM   #3
snehalvolvoikar29
LQ Newbie
 
Registered: Dec 2019
Posts: 2

Original Poster
Rep: Reputation: Disabled
Below are the permissions set for my folders/files (including wp-content).

-rw-r-xr-- 1 root root 420 Nov 30 2017 index.php
-rw-r-xr-- 1 root root 19935 Jan 1 2019 license.txt
-rw-r-xr-- 1 root root 7368 Sep 2 21:44 readme.html
-rw-r-xr-- 1 root root 6939 Sep 3 00:41 wp-activate.php
drwxr-xr-x 9 root root 4096 Dec 18 22:16 wp-admin
-rw-r-xr-- 1 root root 369 Nov 30 2017 wp-blog-header.php
-rw-r-xr-- 1 root root 2283 Jan 21 2019 wp-comments-post.php
-rw-rwxrw- 1 apache apache 3248 Dec 28 06:16 wp-config.php
-rw-r-xr-- 1 root root 2898 Jan 8 2019 wp-config-sample.php
drwxr-xr-x 4 root root 4096 Dec 28 06:23 wp-content
-rw-r-xr-- 1 root root 3955 Oct 10 22:52 wp-cron.php
drwxr-xr-x 20 root root 12288 Dec 18 22:16 wp-includes
-rw-r-xr-- 1 root root 2504 Sep 3 00:41 wp-links-opml.php
-rw-r-xr-- 1 root root 3326 Sep 3 00:41 wp-load.php
-rw-r-xr-- 1 root root 47597 Dec 9 13:30 wp-login.php
-rw-r-xr-- 1 root root 8483 Sep 3 00:41 wp-mail.php
-rw-r-xr-- 1 root root 19120 Oct 15 15:37 wp-settings.php
-rw-r-xr-- 1 root root 31112 Sep 3 00:41 wp-signup.php
-rw-r-xr-- 1 root root 4764 Nov 30 2017 wp-trackback.php
-rw-r-xr-- 1 root root 3150 Jul 1 08:01 xmlrpc.php

Upon research I know that I have to set below mentioned permissions:
755 for all folders and sub-folders.
644 for all files

Please mention the linux commands for the same.
 
Old 12-28-2019, 06:08 AM   #4
berndbausch
LQ Guru
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 5,670

Rep: Reputation: 1701Reputation: 1701Reputation: 1701Reputation: 1701Reputation: 1701Reputation: 1701Reputation: 1701Reputation: 1701Reputation: 1701Reputation: 1701Reputation: 1701
Quote:
Originally Posted by snehalvolvoikar29 View Post
Below are the permissions set for my folders/files (including wp-content).

-rw-r-xr-- 1 root root 420 Nov 30 2017 index.php
-rw-r-xr-- 1 root root 19935 Jan 1 2019 license.txt
-rw-r-xr-- 1 root root 7368 Sep 2 21:44 readme.html
-rw-r-xr-- 1 root root 6939 Sep 3 00:41 wp-activate.php
drwxr-xr-x 9 root root 4096 Dec 18 22:16 wp-admin
-rw-r-xr-- 1 root root 369 Nov 30 2017 wp-blog-header.php
-rw-r-xr-- 1 root root 2283 Jan 21 2019 wp-comments-post.php
-rw-rwxrw- 1 apache apache 3248 Dec 28 06:16 wp-config.php
-rw-r-xr-- 1 root root 2898 Jan 8 2019 wp-config-sample.php
drwxr-xr-x 4 root root 4096 Dec 28 06:23 wp-content
-rw-r-xr-- 1 root root 3955 Oct 10 22:52 wp-cron.php
drwxr-xr-x 20 root root 12288 Dec 18 22:16 wp-includes
-rw-r-xr-- 1 root root 2504 Sep 3 00:41 wp-links-opml.php
-rw-r-xr-- 1 root root 3326 Sep 3 00:41 wp-load.php
-rw-r-xr-- 1 root root 47597 Dec 9 13:30 wp-login.php
-rw-r-xr-- 1 root root 8483 Sep 3 00:41 wp-mail.php
-rw-r-xr-- 1 root root 19120 Oct 15 15:37 wp-settings.php
-rw-r-xr-- 1 root root 31112 Sep 3 00:41 wp-signup.php
-rw-r-xr-- 1 root root 4764 Nov 30 2017 wp-trackback.php
-rw-r-xr-- 1 root root 3150 Jul 1 08:01 xmlrpc.php
I don't see the upload folder in that list.
Quote:
Upon research I know that I have to set below mentioned permissions:
755 for all folders and sub-folders.
644 for all files
I doubt that your research result is correct.
Quote:
Please mention the linux commands for the same.
Code:
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
However, I suggest you research some more. And that you answer the questions in my first reply.
 
Old 12-28-2019, 11:43 AM   #5
wdtr2005
LQ Newbie
 
Registered: Mar 2009
Posts: 3

Rep: Reputation: 0
ls -la is the command to see files and directories

drwxr-xr-x 5 root root 4096 Dec 28 05:21 wp-content

The d shows it is a directory. owner root group root
permissions are in blocks of 3.

d rwx r-x r-x so the 1st 3 are fore the owner. read/write/exec exec for a dir means you can do the "cd" command
r-x the 2nd of 3 is for the group. read/exec people in that group can go to this directory but not create files
r-x the 3rd of 3 ... known as other. It is every user user on the system.

do you have the wordpress server running on your linux box? If yes, you need to learn the id wordpress is running as. I am guessing it is not root. I think you need to make the owner of the sub-dir wp-content the id wordpress is running as.

chown <user> wp-content
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Permissions Permissions Permissions! makem Linux - Newbie 13 07-30-2015 12:54 PM
[SOLVED] sftp fails pubkey - NOT permissions issue, NOT sshd_config issue MensaWater Linux - Software 3 07-14-2014 11:36 AM
Linux File Server Permissions issue- ULTRA Newb needs help! shiftdelete Linux - Newbie 7 04-23-2008 08:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration