{"id":4095,"date":"2018-01-18T17:02:57","date_gmt":"2018-01-18T22:02:57","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=4095"},"modified":"2018-02-06T11:45:17","modified_gmt":"2018-02-06T16:45:17","slug":"linux-file-permissions-attributes-chmod","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/","title":{"rendered":"Introduction to Linux file permissions &#038; attributes: chmod"},"content":{"rendered":"<h1>Introduction to Linux file permissions &amp; attributes: chmod<\/h1>\n<div class=\"row\">\n<div class=\"col-lg-8\">\n<p>The <a href=\"https:\/\/en.wikipedia.org\/wiki\/Linux\" target=\"_blank\" rel=\"nofollow noopener\">Linux<\/a> name is a broad identifier for a variety of operating systems that are based on the Linux kernel; these operating systems are free and open-source, providing a variety of solutions for users of different skill levels. Using Linux-based systems, the user often has more reliance on system commands and command line tools; maintaining file permissions and attributes is one example of this. Linux file permissions, the permissions allowing users to access different system objects, files, and directories, are modified with the chmod command. Maintaining proper file permissions is essential in shared environments where multiple users do not share the same access requirements to files and systems.<\/p>\n<\/div>\n<div class=\"col-lg-4\"><a href=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2018\/01\/chmod.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-4099 size-full\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2018\/01\/chmod.png\" alt=\"chmod\" width=\"500\" height=\"332\" \/><\/a><\/div>\n<\/div>\n<h2>Getting Started<\/h2>\n<p>To get started understanding more about file permissions and attributes, you should have a <a href=\"https:\/\/www.globo.tech\/cloud-server-pricing\" target=\"_blank\" rel=\"noopener\"><b>cloud server<\/b><\/a> or <a href=\"https:\/\/www.globo.tech\/dedicated-server-hosting\" target=\"_blank\" rel=\"noopener\"><b>dedicated server<\/b><\/a> node running a current version of whichever Linux operating system you choose. For beginners, Linux Ubuntu is a popular distribution providing a user-friendly interface. Research the available options and choose a distribution that works for you.<\/p>\n<h2>An Introduction to Linux File Permissions and Attributes: chmod<\/h2>\n<p>When using the chmod command to alter your file permissions and attributes, there are different aspects of the command syntax that you may encounter.<br \/>\nFor instance, there are implementation options that you may encounter, such as <b>recursive (-R)<\/b>, <b>force (-f)<\/b>, and <b>verbose (-v)<\/b>. The recursive implementation is the most commonly used, and it is used to apply permissions to all the documents within the specified directory. The force implementation can be used when implementation should move forward even if errors occur, while the verbose implementation shows the objects as they&#8217;re processed.<\/p>\n<p>An example would be to give read, write, execute access (7) to owner (u) and group (g) , but no access (0) to others (o); using the recursive function (-R) to apply the same level of permissions to all documents contained within \/my\/directory.<\/p>\n<p><code>sudo chmod -R 770 \/my\/directory<\/code><\/p>\n<h2>The Symbolic Mode<\/h2>\n<p>Permissions can be assigned as <b>read (r)<\/b>, <b>write (w)<\/b>, and <b>execute (x)<\/b> access; this is considered symbolic mode.<\/p>\n<p>When the permissions are displayed, they are displayed in a combination of letters indicating the permissions for the owner, the group, and anyone else. To see an example of the notation in your Linux operating system, open terminal and type <b>ls -l \/etc<\/b>, which will list the content of \/etc including permissions.<\/p>\n<div class=\"row\">\n<div class=\"col-lg-2\"><\/div>\n<div class=\"col-lg-8\"><img loading=\"lazy\" decoding=\"async\" width=\"658\" height=\"216\" class=\"alignright size-full wp-image-4116\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2018\/01\/ls-l-etc.png\" alt=\"ls -l \/etc\" \/><\/div>\n<div class=\"col-lg-2\"><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>An example of this would be &#8220;drwxrwx&#8212;,&#8221; which shows that the owner (d<b>rwx<\/b>rwx&#8212;) and those in the group (drwx<b>rwx<\/b>&#8212;) can read, write, and execute; anyone else outside (drwxrwx<b>&#8212;<\/b>) of the specified owner and group have no permissions. The dash (-) will occur where a permission is not given.<\/p>\n<p>You can also use the symbolic mode in more specific instances where you want to make changes to specific users. There are four references; <b>owner (u)<\/b>, <b>group (g)<\/b>, <b>others (o)<\/b>, and <b>all (a or ugo)<\/b>.<\/p>\n<div class=\"row\">\n<div class=\"col-lg-4\"><\/div>\n<div class=\"col-lg-4\"><img loading=\"lazy\" decoding=\"async\" width=\"378\" height=\"77\" class=\"alignright size-full wp-image-4106\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2018\/01\/Octal-Mode.png\" alt=\"chmod: Symbolic Mode\" \/><\/div>\n<div class=\"col-lg-4\"><\/div>\n<\/div>\n<p>The owner is the owner of the file while the group is users that are part of the file&#8217;s group membership. The others identifier encompasses users that are neither owner nor group members, and all can be used when the permissions want to be set for all three previous user groups simultaneously.<\/p>\n<p>When adding permissions to these users, the <b>plus sign (+)<\/b> is used to add the specified mode to the specified class, the <b>minus sign (-<\/b>) is used to remove the specified mode from the specified class, and the <b>equal sign (=)<\/b> is used when the specified mode should be the exact mode for the specific class.<\/p>\n<p>An example of this would be &#8220;u+w,&#8221; which would add write permission to the user.<br \/>\n<code>sudo chmod u+w \/my\/directory\/<\/code><\/p>\n<p>Another example would be &#8220;g-w,&#8221; would remove write permissions for the group.<br \/>\n<code>sudo chmod g-w \/my\/directory\/<\/code><\/p>\n<h2>The Numeric Mode<\/h2>\n<p>Permissions may also be displayed in numeric mode, numbering from 0 to 7. The permissions, in ascending order, are <b>no permission (0)<\/b>, <b>execute (1)<\/b>, <b>write (2)<\/b>, <b>write and execute (3)<\/b>, <b>read (4)<\/b>, <b>read and execute (5)<\/b>, <b>read and write (6)<\/b>, and <b>read, write, and execute (7)<\/b>.<\/p>\n<p>For instance, in the <b>symbolic<\/b> system, a permission could be displayed as <b>&#8220;-rw-r&#8211;r&#8211;,&#8221;<\/b> which could be translated into the <b>numeric<\/b> mode as <b>&#8220;664&#8221;<\/b>. This would indicate the first two users can read and write in this directory, while the third user can only read in this directory.<br \/>\n<code>sudo chmod -R 644 \/my\/directory\/<\/code><\/p>\n<div class=\"row\">\n<div class=\"col-lg-4\"><\/div>\n<div class=\"col-lg-4\"><img loading=\"lazy\" decoding=\"async\" width=\"304\" height=\"179\" class=\"alignright size-full wp-image-4124\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2018\/01\/chmod-Notation-1.png\" alt=\"chmod symbolic numeric\" \/><\/div>\n<div class=\"col-lg-4\"><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<h2>Conclusion<\/h2>\n<p>Hopefully, this introduction to Linux file permissions and the chmod command have given you more insight into your Linux operating system. It&#8217;s important to learn more about the ins and outs of the Linux system, making changes and updates to your operating system can be accomplished with simple commands, but it&#8217;s important to understand what commands you can use and how to utilize the command input systems.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Introduction to Linux file permissions &amp; attributes: chmod The Linux name is a broad identifier for a variety of operating systems that are based on the Linux kernel; these operating systems are free and open-source, providing a variety of solutions for users of different skill levels. Using Linux-based systems, the user often has more reliance<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":4099,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[],"class_list":["post-4095","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Introduction to Linux file permissions &amp; attributes: chmod - Globo.Tech<\/title>\n<meta name=\"description\" content=\"Introduction to Linux file permissions &amp; attributes: chmod. When using the chmod command to alter your file permissions and attributes, there are differe...\" \/>\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.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Introduction to Linux file permissions &amp; attributes: chmod - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"Introduction to Linux file permissions &amp; attributes: chmod. When using the chmod command to alter your file permissions and attributes, there are differe...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2018-01-18T22:02:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-02-06T16:45:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2018\/01\/chmod.png\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"332\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\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\":\"WebPage\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/\",\"name\":\"Introduction to Linux file permissions & attributes: chmod - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2018\/01\/chmod.png\",\"datePublished\":\"2018-01-18T22:02:57+00:00\",\"dateModified\":\"2018-02-06T16:45:17+00:00\",\"author\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"Introduction to Linux file permissions & attributes: chmod. When using the chmod command to alter your file permissions and attributes, there are differe...\",\"breadcrumb\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/#primaryimage\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2018\/01\/chmod.png\",\"contentUrl\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2018\/01\/chmod.png\",\"width\":500,\"height\":332,\"caption\":\"chmod\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.globo.tech\/learning-center\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Introduction to Linux file permissions &#038; attributes: chmod\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\/\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Introduction to Linux file permissions & attributes: chmod - Globo.Tech","description":"Introduction to Linux file permissions & attributes: chmod. When using the chmod command to alter your file permissions and attributes, there are differe...","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.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/","og_locale":"en_US","og_type":"article","og_title":"Introduction to Linux file permissions & attributes: chmod - Globo.Tech","og_description":"Introduction to Linux file permissions & attributes: chmod. When using the chmod command to alter your file permissions and attributes, there are differe...","og_url":"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/","og_site_name":"Globo.Tech","article_published_time":"2018-01-18T22:02:57+00:00","article_modified_time":"2018-02-06T16:45:17+00:00","og_image":[{"width":500,"height":332,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2018\/01\/chmod.png","type":"image\/png"}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/","url":"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/","name":"Introduction to Linux file permissions & attributes: chmod - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/#primaryimage"},"image":{"@id":"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/#primaryimage"},"thumbnailUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2018\/01\/chmod.png","datePublished":"2018-01-18T22:02:57+00:00","dateModified":"2018-02-06T16:45:17+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"Introduction to Linux file permissions & attributes: chmod. When using the chmod command to alter your file permissions and attributes, there are differe...","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/#primaryimage","url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2018\/01\/chmod.png","contentUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2018\/01\/chmod.png","width":500,"height":332,"caption":"chmod"},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/linux-file-permissions-attributes-chmod\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"Introduction to Linux file permissions &#038; attributes: chmod"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/4095","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=4095"}],"version-history":[{"count":29,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/4095\/revisions"}],"predecessor-version":[{"id":4155,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/4095\/revisions\/4155"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media\/4099"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=4095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=4095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=4095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}