{"id":21778,"date":"2023-10-01T03:09:53","date_gmt":"2023-10-01T03:09:53","guid":{"rendered":"https:\/\/linuxways.net\/?p=21778"},"modified":"2023-10-01T03:10:34","modified_gmt":"2023-10-01T03:10:34","slug":"how-does-chmod-777-work-in-linux-ubuntu","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-does-chmod-777-work-in-linux-ubuntu\/","title":{"rendered":"How does Chmod 777 Work in Linux\/Ubuntu"},"content":{"rendered":"<p><strong>Chmod (Change Mode) <\/strong>command enables the user to modify the access permissions of folders\/directories and files in Unix-based systems such as Linux and macOS. <strong>Chmod 777 <\/strong>enables all permissions, i.e., read, write, and execute to everyone, i.e., user\/owner, group, and others (all users).<\/p>\n<p>This article will demonstrate how to change the permissions of a file and a directory by using chmod 777 command in Linux\/Ubuntu 22.04 LTS:<\/p>\n<ul>\n<li>What is Chmod 777 in Linux\/Ubuntu?<\/li>\n<li>How to Change File Permission Using chmod 777 in Linux\/Ubuntu?<\/li>\n<li>How to Change Directory Permission Using chmod 777 in Linux\/Ubuntu?<\/li>\n<\/ul>\n<h2><a id=\"post-21778-_mqyaakxtb9ol\"><\/a>What is Chmod 777 in Linux\/Ubuntu?<\/h2>\n<p><strong>Chmod 777 <\/strong>enables read, write, and execute permissions to everyone, i.e., owner, group, and others. More details of Linux\/Ubuntu file permissions can be checked from <a href=\"https:\/\/linuxways.net\/de\/how-to-change-file-permissions-and-ownership-in-linux-ubuntu\/\">How to Change File Permissions and Ownership in Linux\/Ubuntu?<\/a> The general syntax of chmod 777 command is:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">chmod<\/span> <span class=\"nu0\">777<\/span> <span class=\"sy0\">&lt;<\/span>file<span class=\"sy0\">\/<\/span>directory<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>Where,<\/p>\n<ul>\n<li>Chmod: Chmod command<\/li>\n<li>777: Read, Write, and Execute permission for all (user, group, and others)<\/li>\n<li>&lt;file\/directory&gt;: File or Directory<\/li>\n<\/ul>\n<p>Additionally, 777 is calculated by:<\/p>\n<ul>\n<li>The first digit 7 is the sum of 4, 2, and 1 for read, write, and execute permission for the user\/owner.<\/li>\n<li>The second digit 7 is the sum of 4, 2, and 1 for read, write, and execute permission for the users of the group.<\/li>\n<li>The third digit 7 is the sum of 4, 2, and 1 for read, write, and execute permission for others.<\/li>\n<\/ul>\n<h2><a id=\"post-21778-_ys7d4valzh29\"><\/a>How to Change File Permission Using chmod 777 in Linux\/Ubuntu?<\/h2>\n<p>Consider we have to change the file permission of a \u201cSampleFile.txt\u201d. We can first view the file permissions of it by executing the \u201cls\u201d command as follows:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">ls<\/span> <span class=\"re5\">-l<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"247\" class=\"wp-image-21779\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-1.png 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-1-300x36.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-1-1024x124.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-1-768x93.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-1-1536x185.png 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/p>\n<p>In the above image, we can see that the permission of \u201cSampleFile.txt\u201d is \u201c-rw-rw-r\u2013\u201d, i.e., this file has read, and write permission for user(u); read, write permission for group (g) and read permission for others(o). We can change permission by running chmod 777 command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">chmod<\/span> <span class=\"nu0\">777<\/span> SampleFile.txt<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"480\" class=\"wp-image-21780\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-2.png 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-2-300x70.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-2-1024x240.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-2-768x180.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-2-1536x360.png 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/p>\n<p>From the above image, we can see that the file permissions are changed to read, write, and execute for user(u), group(g), and others(o).<\/p>\n<h2><a id=\"post-21778-_o7zy10e2c215\"><\/a>How to Change Directory Permission Using chmod 777 in Linux\/Ubuntu?<\/h2>\n<p>Consider we have to change the permission of a directory \u201cFiles1\u201d. We can first view the permissions associated to it by using the ls command as follows:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">ls<\/span> <span class=\"re5\">-l<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"301\" class=\"wp-image-21781\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-3.png 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-3-300x44.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-3-1024x151.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-3-768x113.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-3-1536x226.png 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/p>\n<p>In the above image, we can see that the permission of \u201cFiles1\u201d is \u201cdrwxr-xr-x\u201d, i.e., this directory has read, write, and execution permission for the user(u); read and execution permission for the group (g) and read and execution permission for others(o). We can change permission by running chmod 777 command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">chmod<\/span> <span class=\"nu0\">777<\/span> Files1<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"479\" class=\"wp-image-21782\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-4.png 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-4-300x70.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-4-1024x240.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-4-768x180.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/10\/word-image-21778-4-1536x359.png 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/p>\n<p>From the above image, we can see that the file permissions are changed to read, write, and execute for user(u), group(g), and others(o).<\/p>\n<h2><a id=\"post-21778-_k4r3ojha6hv3\"><\/a>Conclusion<\/h2>\n<p>File\/Directory read, write, and execute permissions to owner, group, and other classes are enabled using \u201cchmod 777 &lt;file\/directory&gt;\u201d. This article has demonstrated how to change file and directory permissions by using the chmod 777 command in Linux\/Ubuntu 22.04 LTS. Additionally, Chmod 777 is advised to be used with care as all permissions of read, write, and execute are even to everyone, user, group, and others.<\/p>","protected":false},"excerpt":{"rendered":"<p>File\/Directory read, write, and execute permissions to owner, group, and other classes are enabled using \u201cchmod 777 <file>\u201d. <\/p>","protected":false},"author":110,"featured_media":21783,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-21778","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/21778","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=21778"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/21778\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/21783"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=21778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=21778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=21778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}