{"id":30223,"date":"2021-01-18T03:43:07","date_gmt":"2021-01-17T19:43:07","guid":{"rendered":"https:\/\/web.mwwsb.com.my\/pjci\/?post_type=kb&#038;p=30223"},"modified":"2023-01-18T11:52:21","modified_gmt":"2023-01-18T03:52:21","slug":"file-folder-permission-info","status":"publish","type":"kb","link":"https:\/\/www.casbay.com\/guide\/kb\/file-folder-permission-info","title":{"rendered":"File &#038; Folder Permission [INFO]"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"30223\" class=\"elementor elementor-30223\" data-elementor-post-type=\"kb\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-3a74b63 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3a74b63\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-486350e\" data-id=\"486350e\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-4c1d5d0 elementor-widget elementor-widget-heading\" data-id=\"4c1d5d0\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">File & Folder Permission<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8b63c58 elementor-widget elementor-widget-text-editor\" data-id=\"8b63c58\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div>First,\u00a0<strong>Folder Permission<\/strong>\u00a0\u2013&gt;\u00a0755\u00a0 (User:\u00a0<em>read&amp;write&amp;execute<\/em>\u00a0\u00a0 \/ Group:\u00a0\u00a0<em>read&amp;execute<\/em>\u00a0 \/ World :\u00a0<em>read&amp;execute<\/em>)\u00a0 permissions.<\/div><div>\u00a0<\/div><div>After that,\u00a0<strong>File Permission<\/strong>\u00a0\u2013&gt;\u00a0644\u00a0(User:\u00a0<em>read&amp;write<\/em>\u00a0 \/ Group:\u00a0\u00a0<em>read\u00a0<\/em>\u00a0\/\u00a0 World:\u00a0\u00a0<em>read<\/em>)\u00a0 permissions.<\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-efd8a20 elementor-widget elementor-widget-heading\" data-id=\"efd8a20\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-medium\">The Unix files access is\u00a0controlled. There are three types of access (permissions):<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-bb9e624 elementor-widget elementor-widget-text-editor\" data-id=\"bb9e624\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<ul><li>read<\/li><li>write<\/li><li>execute<\/li><\/ul><p>Each file belongs to a specific user and group (ownership). Access to the files is controlled by\u00a0<em>user<\/em>,\u00a0<em>group<\/em>, and what is called\u00a0<em>other\/everyone<\/em>\u00a0permission bits and is usually set using a numerical value.<\/p><p class=\"bold\">For example,\u00a0<strong>644<\/strong>\u00a0as permission bit will result in:<\/p><pre><code class=\"default hljs\">Owner\/User Group Other\/Everyone 644<\/code><\/pre><p>Each number represents the access level and it can be from 0 to 7.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-dd68f9d elementor-widget elementor-widget-heading\" data-id=\"dd68f9d\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Different access levels depending on the numbers:<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-376a355 elementor-widget elementor-widget-text-editor\" data-id=\"376a355\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<ul><li>0 \u2013 no access to the file whatsoever<\/li><li>1 \u2013 execute permissions only<\/li><li>2 \u2013 write permissions only<\/li><li>3 \u2013 write and execute permissions<\/li><li>4 \u2013 read permissions only<\/li><li>5 \u2013 read and execute permissions<\/li><li>6 \u2013 read and write permissions<\/li><li>7 \u2013 read, write and execute permissions (full permissions)<\/li><\/ul><p class=\"heading h3\">Thus the above\u00a0<strong>644<\/strong>\u00a0permissions example will look like this:<\/p><pre><code class=\"default hljs coffeescript\">Owner\/User - Read <span class=\"hljs-keyword\">and<\/span> Write\nGroup - Read only\nOther\/Everyone - Read only<\/code><\/pre><p>You can execute a script to allow everyone to read it but the only one who can write in it is your user. Therefore, you would need to set <strong>755<\/strong>\u00a0as permissions:<\/p><pre><code class=\"default hljs perl\">Owner\/User - <span class=\"hljs-number\">7<\/span> - Full permissions\nGroup - <span class=\"hljs-number\">5<\/span> - <span class=\"hljs-keyword\">read<\/span> <span class=\"hljs-keyword\">and<\/span> execute\nOther\/Everyone - <span class=\"hljs-number\">5<\/span> - <span class=\"hljs-keyword\">read<\/span> <span class=\"hljs-keyword\">and<\/span> execute<\/code><\/pre><p>Changing the permissions to\u00a0<strong>700<\/strong> will make the file visible only for your username. No one else and setting it to <strong>444<\/strong>\u00a0will allow only the file creator to modify it.<\/p><p class=\"bold\">Furthermore, the command you need to execute to actually change the permissions is called \u2018<strong>chmod<\/strong>\u2019. Its syntax looks like this:<\/p><pre><code class=\"default hljs nginx\"><span class=\"hljs-attribute\">chmod<\/span> <span class=\"hljs-number\">755<\/span> file_name<\/code><\/pre><p>The above example changes the permissions of the\u00a0<em>file_name<\/em>\u00a0file and sets them to\u00a0<strong>755<\/strong>.<\/p><p>You can recursively change the permissions of all folders and files using the recursive argument:<\/p><pre><code class=\"default hljs nginx\"><span class=\"hljs-attribute\">chmod<\/span> -R <span class=\"hljs-number\">755<\/span><\/code><\/pre><p>This will modify the permissions of all files in the current folder and set them to\u00a0<strong>755<\/strong>.<\/p><p>Now you might wonder what the above user\/group values are. These two settings are the actual ownership flags for a file or a folder. Each file has a primary user that owns it and a group assigned to it. To change those values, a special command exists \u2014 \u2018<strong>chown<\/strong>\u2019. Its syntax is:<\/p><pre><code class=\"default hljs cs\">chown user:<span class=\"hljs-keyword\">group<\/span> file<\/code><\/pre><p class=\"bold\">For example:<\/p><pre><code class=\"default hljs css\"><span class=\"hljs-selector-tag\">chown<\/span> <span class=\"hljs-selector-tag\">user<\/span><span class=\"hljs-selector-pseudo\">:siteground<\/span> <span class=\"hljs-selector-tag\">file_name<\/span><\/code><\/pre><p>The above line will set the owner of the file to \u2018<em>user<\/em>\u2019 and the group to \u2018<em>siteground<\/em>\u2019.<\/p><p>Moreover, changing ownership recursively is also permitted. The flag is <strong>-R<\/strong>:<\/p><pre><code class=\"default hljs css\"><span class=\"hljs-selector-tag\">chown<\/span> <span class=\"hljs-selector-tag\">-R<\/span> <span class=\"hljs-selector-tag\">user<\/span><span class=\"hljs-selector-pseudo\">:siteground<\/span> *<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-871fe19 elementor-widget elementor-widget-text-editor\" data-id=\"871fe19\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>For more articles on the topic Security, proceed to our <a href=\"https:\/\/www.casbay.com\/guide\/kb\/how-to-change-the-listening-port-for-remote-desktop\">Knowledge Base<\/a> to find out more.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2d0df7b elementor-widget elementor-widget-text-editor\" data-id=\"2d0df7b\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>File &amp; Folder Permission First,\u00a0Folder Permission\u00a0\u2013&gt;\u00a0755\u00a0 (User:\u00a0read&amp;write&amp;execute\u00a0\u00a0 \/ Group:\u00a0\u00a0read&amp;execute\u00a0 \/ World :\u00a0read&amp;execute)\u00a0 permissions.\u00a0After that,\u00a0File Permission\u00a0\u2013&gt;\u00a0644\u00a0(User:\u00a0read&amp;write\u00a0 \/ Group:\u00a0\u00a0read\u00a0\u00a0\/\u00a0 World:\u00a0\u00a0read)\u00a0 permissions. The Unix files access is\u00a0controlled. There are three types of access (permissions): read write execute Each file belongs to a specific user and group (ownership). Access to the files is controlled by\u00a0user,\u00a0group, and what is called\u00a0other\/everyone\u00a0permission [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}}},"kbtopic":[113],"kbtag":[106],"mkb_version":[],"_links":{"self":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/30223"}],"collection":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/comments?post=30223"}],"version-history":[{"count":3,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/30223\/revisions"}],"predecessor-version":[{"id":38221,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/30223\/revisions\/38221"}],"wp:attachment":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/media?parent=30223"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=30223"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kbtag?post=30223"},{"taxonomy":"mkb_version","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/mkb_version?post=30223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}