{"id":3343,"date":"2014-07-07T18:54:00","date_gmt":"2014-07-07T18:54:00","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2014\/07\/07\/file-permissions\/"},"modified":"2021-08-16T22:58:33","modified_gmt":"2021-08-17T02:58:33","slug":"file-permissions","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/","title":{"rendered":"All About File Permissions"},"content":{"rendered":"<div class=\"in_this_tutorial\">\n<h2>In this tutorial:<\/h2>\n<p><a class=\"btn btn-primary\" href=\"#user\" type=\"button\">User Types<\/a> <a class=\"btn btn-primary\" href=\"#permission\" type=\"button\">Permission Types<\/a> <a class=\"btn btn-primary\" href=\"#mode\" type=\"button\">The Mode<\/a><\/p>\n<\/div>\n<p>Understanding how permissions work when you <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/cpanel\/change-file-permissions\/\">set them within your cPanel<\/a> or <a href=\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-login-ssh\/\">using SSH (Shell) access<\/a> is very important. If permissions are too lax, they may be accessed by unwanted users who may alter or remove them. If the permissions are too strict, then they may not be accessed by the right users to perform tasks as needed. This guide discusses permissions and how they work so you can set them with the proper amount of security.<\/p>\n<p><a name=\"user\"><\/a><\/p>\n<h2>User types<\/h2>\n<p>All users fall into one of three categories. These categories are <em>User<\/em>, <em>Group<\/em>, and <em>World<\/em>. The <em>User<\/em> type is the individual account that creates the file or folder. The <em>Group<\/em> is listed as the group that the user belongs to, and the <em>World<\/em> setting encompasses everyone else.<\/p>\n<table class=\"article_table\">\n<tbody>\n<tr>\n<th width=\"100px\">User Type<\/th>\n<th>File definition<\/th>\n<th>Folder definition<\/th>\n<\/tr>\n<tr>\n<td>User<\/td>\n<td>Allows the file to be opened and its contents read.<\/td>\n<td>Allows the user to view (list) the contents of the folder (also requires the execute permission).<\/td>\n<\/tr>\n<tr>\n<td>Group<\/td>\n<td>Allows a file to be opened, read, and edited.<\/td>\n<td>Allows the user to add or remove files within a folder (also requires the execute permission).<\/td>\n<\/tr>\n<tr>\n<td>World<\/td>\n<td>Allows the contents of the file to be executed in the server\u2019s memory as well as shell scripts.<\/td>\n<td>Allows the user to be able to enter the folder as well as manipulate its contents.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a name=\"permission\"><\/a><\/p>\n<h2>Permission types<\/h2>\n<p>Just like there are three types of users to which permissions can be assigned, there are also three types of permissions. These are <em>Read<\/em>, <em>Write<\/em>, and <em>Execute<\/em>. Note in the chart below that each permission has an numeric value. This is used for calculating the value for displaying in the octal mode.<\/p>\n<table class=\"article_table\">\n<tbody>\n<tr>\n<th>Permission<\/th>\n<th>Description<\/th>\n<th>Octal value<\/th>\n<\/tr>\n<tr>\n<td>Read (r)<\/td>\n<td>This permission allows the file to be opened and read by the user, ie: they can see the contents of the file or folder.<\/td>\n<td>4<\/td>\n<\/tr>\n<tr>\n<td>Write (w)<\/td>\n<td>This permission allows the user to make changes to the file.<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>Execute (x)<\/td>\n<td>This permission allows the execution of the file\u2019s contents.<\/td>\n<td>1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a name=\"mode\"><\/a><\/p>\n<h2>The Mode<\/h2>\n<p>Every file and folder on the server has file permissions information attached to it. The term <em>mode<\/em> is used to define the collection of three sets of permissions that each file or folder has. The mode can be viewed in two different formats. The default in the <a href=\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/command-line-tutorials\/\">command line<\/a> console is the long form. This is where the permissions are displayed as a string of all the permissions as one long alphabetic line. The cPanel user interface, however, displays the permissions in numeric, or octal, format.<\/p>\n<h3>Long Form<\/h3>\n<p>The long form may look difficult at first, but once you understand how it is formatted it is quite easy. It is divided up into three different sections. The <em>User<\/em> section comprises the first three columns, followed by the <em>Group<\/em> section and then the <em>World<\/em> section. They are displayed all together like this example where we show a permission structure that grants all three permissions to all three user types.<\/p>\n<pre class=\"cli\">rwxrwxrwx<\/pre>\n<p>If you separate the different sections visually, they make more sense. Below we show a permission structure where all users are granted all permissions broken apart so you can understand them a bit better.<\/p>\n<pre class=\"cli\">rwx  rwx  rwx<\/pre>\n<p>If a permission is granted to a user type, the representative letter will appear in the mode. If the permission is not granted, it is displayed as a dash \u2018-\u2018. Below is the example of a popular permission setup where the <em>Group<\/em> and <em>World<\/em> user types do not have <em>Write<\/em> permissions.<\/p>\n<pre class=\"cli\">rwx  r-x  r-x<\/pre>\n<h3>Octal Mode<\/h3>\n<p>When viewing your file structure in the cPanel GUI (graphical user interface) the permissions are displayed as a three digit number. This is known as the octal form. Instead of three columns for each user type, there is a single column. The number in that column is the total of the values of their permissions granted to that user type. Below is an example of how the permissions display in the cPanel File Manager.<\/p>\n<p><img decoding=\"async\" class=\"\" title=\"Click here to view the larger image\" src=\"\/support\/images\/stories\/edu\/linux\/file-perms\/numeric.png\" alt=\"File Permissions\" width=\"100%\"><\/p>\n<p>To read the octal format is very easy, below is a chart that displays the range of possible permissions.<\/p>\n<table class=\"article_table\">\n<tbody>\n<tr>\n<th>Number<\/th>\n<th>Permissions<\/th>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>None<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>Execute<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>Write<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>Write and Execute<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>Read<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>Read and Execute<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>Read and Write<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>Read Write and Execute<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The octal format is laid out in the same format for user types as the long format. The first column is the <em>User<\/em>, the second is the <em>Group<\/em> and the third is the <em>World<\/em>. The mode is always displayed together, so 755 is a popular mode that gives all permissions (7) to the <em>User<\/em>, but only <em>Read<\/em> and <em>Execute<\/em> permissions (5) to the Group and World user types.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial: User Types Permission Types The Mode Understanding how permissions work when you set them within your cPanel or using SSH (Shell) access is very important. If permissions are too lax, they may be accessed by unwanted users who may alter or remove them. If the permissions are too strict, then they may<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/\"> Read More ><\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4299],"tags":[],"class_list":["post-3343","post","type-post","status-publish","format-standard","hentry","category-security"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>All About File Permissions | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"Learn about Linux file permissions in this short friendly article.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"All About File Permissions | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Learn about Linux file permissions in this short friendly article.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2014-07-07T18:54:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-17T02:58:33+00:00\" \/>\n<meta name=\"author\" content=\"Scott Mitchell\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Scott Mitchell\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/\"},\"author\":{\"name\":\"Scott Mitchell\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed\"},\"headline\":\"All About File Permissions\",\"datePublished\":\"2014-07-07T18:54:00+00:00\",\"dateModified\":\"2021-08-17T02:58:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/\"},\"wordCount\":767,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/\",\"name\":\"All About File Permissions | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2014-07-07T18:54:00+00:00\",\"dateModified\":\"2021-08-17T02:58:33+00:00\",\"description\":\"Learn about Linux file permissions in this short friendly article.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"All About File Permissions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed\",\"name\":\"Scott Mitchell\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/scott\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"All About File Permissions | InMotion Hosting","description":"Learn about Linux file permissions in this short friendly article.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/","og_locale":"en_US","og_type":"article","og_title":"All About File Permissions | InMotion Hosting","og_description":"Learn about Linux file permissions in this short friendly article.","og_url":"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2014-07-07T18:54:00+00:00","article_modified_time":"2021-08-17T02:58:33+00:00","author":"Scott Mitchell","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Scott Mitchell","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/"},"author":{"name":"Scott Mitchell","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed"},"headline":"All About File Permissions","datePublished":"2014-07-07T18:54:00+00:00","dateModified":"2021-08-17T02:58:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/"},"wordCount":767,"commentCount":4,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/","url":"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/","name":"All About File Permissions | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2014-07-07T18:54:00+00:00","dateModified":"2021-08-17T02:58:33+00:00","description":"Learn about Linux file permissions in this short friendly article.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/security\/file-permissions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"All About File Permissions"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed","name":"Scott Mitchell","url":"https:\/\/www.inmotionhosting.com\/support\/author\/scott\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3343","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=3343"}],"version-history":[{"count":3,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3343\/revisions"}],"predecessor-version":[{"id":84223,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3343\/revisions\/84223"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=3343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=3343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=3343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}