{"id":305,"date":"2014-06-11T21:26:22","date_gmt":"2014-06-11T21:26:22","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=305"},"modified":"2014-06-11T21:26:22","modified_gmt":"2014-06-11T21:26:22","slug":"change-ownership-of-files-and-folders","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2014\/06\/11\/change-ownership-of-files-and-folders\/","title":{"rendered":"Change Ownership of Files and Folders"},"content":{"rendered":"<p>To change the ownership of files and folders in a directory. <strong>For a plesk httpdocs directory that runs fastcgi.<\/strong> For apache &#8211; you will want to change this to apache:apache.<\/p>\n<p>Change directory<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ncd \/var\/www\/vhosts\/domain.com\/httpdocs\n\n<\/pre>\n<p>Find who owns the files and folders.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\nls -la\n&#x5B;root@austin httpdocs]# ls -la\ntotal 20\ndrwxr-xr-x  3 mungoadmin psacln 4096 Jun 11 14:16 .\ndrwxr-xr-x 22 mungoadmin psacln 4096 Jun 11 14:13 ..\ndrwxr-xr-x  2 root       root   4096 Jun 11 14:16 anotherdir\n-rw-r--r--  1 root       root      6 Jun 11 14:14 test1.txt\n-rw-r--r--  1 root       root     10 Jun 11 14:15 test2.php\n\n<\/pre>\n<p>You see that some files\/directories are owned by root:root an some by mungoadmin:psacln. We will want to change this to be the ftp user in plesk &#8211; which is mungoadmin:psacln.<\/p>\n<p>To change this run the following (Warning &#8211; make sure you are in the directory you want to change all the files\/directories in):<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;root@austin httpdocs]# chown -R mungoadmin:psacln *\n\n<\/pre>\n<p>Now &#8211; look at the changes<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;root@austin test]# ls -la\ntotal 20\ndrwxr-xr-x  3 mungoadmin psacln 4096 Jun 11 14:16 .\ndrwxr-xr-x 22 mungoadmin psacln 4096 Jun 11 14:13 ..\ndrwxr-xr-x  2 mungoadmin psacln 4096 Jun 11 14:17 anotherdir\n-rw-r--r--  1 mungoadmin psacln    6 Jun 11 14:14 test1.txt\n-rw-r--r--  1 mungoadmin psacln   10 Jun 11 14:15 test2.php\n\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>To change the ownership of files and folders in a directory. For a plesk httpdocs directory that runs fastcgi. For apache &#8211; you will want to change this to apache:apache. Change directory cd \/var\/www\/vhosts\/domain.com\/httpdocs Find who owns the files and folders. ls -la &#x5B;root@austin httpdocs]# ls -la total 20 drwxr-xr-x 3 mungoadmin psacln 4096 Jun &#8230; <a title=\"Change Ownership of Files and Folders\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2014\/06\/11\/change-ownership-of-files-and-folders\/\" aria-label=\"Read more about Change Ownership of Files and Folders\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,86],"tags":[],"class_list":["post-305","post","type-post","status-publish","format-standard","hentry","category-cli","category-plesk"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/305","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=305"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/305\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}