{"id":665,"date":"2019-11-20T09:31:33","date_gmt":"2019-11-20T09:31:33","guid":{"rendered":"http:\/\/blog.hostinger.io\/hostinger-tutorials\/uncategorized\/vpshow-to-change-permissions-and-owners-via-command-line\/"},"modified":"2024-12-19T03:59:44","modified_gmt":"2024-12-19T03:59:44","slug":"how-to-change-permissions-and-ownership-in-linux","status":"publish","type":"post","link":"\/my\/tutorials\/how-to-change-linux-permissions-and-owners","title":{"rendered":"How to change permissions and ownership in Linux"},"content":{"rendered":"<p>Properly managing Linux file permissions and ownership is essential for safety, especially when multiple administrators manage one server. Moreover, using the correct settings ensures your server can run properly.<\/p><p>This article will explain how to change permissions and ownership in Linux. Before that, you will learn about the structure of item permissions and ownership on Linux operating systems.<\/p><p>\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-overview-of-changing-linux-permissions\">Overview of changing Linux permissions<\/h2><p>The commands for changing file and directory permissions are the same. Here are some of the most popular ones:<\/p><ul class=\"wp-block-list\">\n<li><strong>chmod +rwx item<\/strong> &ndash; adds read, write, and execute permissions.<\/li>\n\n\n\n<li><strong>chmod -rwx item<\/strong> &ndash; removes all permissions from an item.<\/li>\n\n\n\n<li><strong>chmod +r item <\/strong>&ndash; grants the read permission over an item.&nbsp;<\/li>\n\n\n\n<li><strong>chmod -x item<\/strong> &ndash; prevents all users from executing the item.&nbsp;<\/li>\n<\/ul><p>You can further fine-tune the permission settings for different users. We&rsquo;ll explain it more in the following sections.<\/p><p>\n\n\n<div><p class=\"important\"><strong>Important!<\/strong><br>\nIf you encounter an error message about privilege when modifying permissions or ownership, start your command with <strong>sudo<\/strong>.<\/p><\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-understanding-the-linux-permissions-model\">Understanding the Linux permissions model<\/h2><p><strong>Users and groups<\/strong><\/p><p>Linux operating systems have three classes to which you can grant permissions and ownership:<\/p><ul class=\"wp-block-list\">\n<li><strong>owner <\/strong>&ndash; a user that possesses the file or folder.&nbsp;<\/li>\n\n\n\n<li><strong>group <\/strong>&ndash; multiple users that belong to the same category.&nbsp;<\/li>\n\n\n\n<li><strong>others<\/strong> &ndash; all users who are neither the owner nor the group member.&nbsp;<\/li>\n<\/ul><p><strong>Permission types<\/strong><\/p><p>In Linux, files and folders have three types of permissions, each with an initial. Here&rsquo;s their explanation:<\/p><ul class=\"wp-block-list\">\n<li><strong>read<\/strong> (<strong>r<\/strong>) &ndash; allows users to view the content of a file or directory.<\/li>\n\n\n\n<li><strong>write<\/strong> (<strong>w<\/strong>) &ndash; lets users edit a file&rsquo;s content. For directories, they can create, delete, and move files within the folder.<\/li>\n\n\n\n<li><strong>execute<\/strong> (<strong>x<\/strong>) &ndash; enables users to run a file. Executable permissions over a folder mean users can open it and gain access to all its data.<\/li>\n<\/ul><h2 class=\"wp-block-heading\" id=\"h-viewing-current-permissions\">Viewing current permissions<\/h2><p>Since managing permissions requires commands, open your system&rsquo;s command-line interface. Use Terminal for a local computer or <a href=\"\/my\/tutorials\/how-to-use-putty-ssh\">connect via SSH<\/a> if you use a remote system like a virtual private server (VPS).<\/p><p>Alternatively, if you use the <a href=\"\/my\/vps-hosting\">Hostinger VPS platform<\/a>, access your system&rsquo;s CLI with one click using <strong>Browser terminal<\/strong>. Simply open your VPS management menu on hPanel and hit the button.&nbsp;<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/my\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner-1024x300.png\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><p>To view files and folders permission in your current working directory, run the following command:<\/p><pre class=\"wp-block-preformatted\">ls -l<\/pre><figure data-wp-context='{\"imageId\":\"69dfbcd6f031c\"}' data-wp-interactive=\"core\/image\" class=\"wp-block-image aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"139\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/11\/list-of-items-and-their-permissions-in-linux-1024x139.png\" alt=\"List of items and their permissions in Linux\n\" class=\"wp-image-120013\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2019\/11\/list-of-items-and-their-permissions-in-linux-1024x139.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2019\/11\/list-of-items-and-their-permissions-in-linux-300x41.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2019\/11\/list-of-items-and-their-permissions-in-linux-150x20.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2019\/11\/list-of-items-and-their-permissions-in-linux-768x104.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2019\/11\/list-of-items-and-their-permissions-in-linux.png 1030w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><p>If you want to check only a specific item, enter this command<\/p><pre class=\"wp-block-preformatted\">ls -l itemname<\/pre><p>You should see the output looks similar to the following:<\/p><pre class=\"wp-block-preformatted\">drwxrwxrwx 2 user1 admins 4096 Sep 12 04:33 config<\/pre><p>This output contains various information. However, since we want to check the permissions and ownership, let&rsquo;s focus on <strong>user1<\/strong>, <strong>admins<\/strong>, <strong>config<\/strong>, and <strong>drwxrw-r&ndash;<\/strong>.<\/p><p>The <strong>user1 <\/strong>placeholder specifies the item&rsquo;s owner, while <strong>admins<\/strong> is the Linux group the user belongs to. The item name is located at the end, which is <strong>config<\/strong>.<\/p><p>The <strong>drwxrw-r&ndash; <\/strong>string<strong> <\/strong>tells you about the item&rsquo;s permission settings. Let&rsquo;s break it down:<\/p><ul class=\"wp-block-list\">\n<li><strong>d<\/strong> &ndash; the first character of the string indicates the type of the item, which can be a directory (<strong>d<\/strong>), a regular file (<strong>&ndash;<\/strong>), or a <a href=\"\/my\/tutorials\/how-to-create-symbolic-links-in-linux\/\">symbolic link<\/a> (<strong>l<\/strong>).<\/li>\n\n\n\n<li><strong>rwx<\/strong> &ndash; the second part specifies the owner&rsquo;s permissions. Since we have <strong>rwx<\/strong>, <strong>user1<\/strong> can read, write, and execute the directory.<\/li>\n\n\n\n<li><strong>rw-<\/strong> &ndash; the third part determines the group permissions over the item. A hyphen (<strong>&ndash;<\/strong>) means missing permission, so the <strong>admins <\/strong>group members can only read and write the directory.&nbsp;<\/li>\n\n\n\n<li><strong>r&ndash; <\/strong>&ndash; the fourth part defines other users&rsquo; permissions. Since we only have an <strong>r<\/strong> and two hyphens, others can only read the directory.&nbsp;<\/li>\n<\/ul><p>\n\n\n<div><p class=\"important\"><strong>Important<\/strong><br>\nThe permission naming structure and order will always remain the same.<\/p><\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-changing-permissions-with-chmod\">Changing permissions with chmod<\/h2><p>To change item permissions, use the <strong>chmod<\/strong> <a href=\"\/my\/tutorials\/linux-commands\">Linux command<\/a>. The syntax looks like the following:<\/p><pre class=\"wp-block-preformatted\">chmod [option] [mode] [file_folder_name]<\/pre><p><strong>Option <\/strong>is an additional flag that modifies your chmod command behavior. You can check the complete list on the <a href=\"https:\/\/linux.die.net\/man\/1\/chmod\" target=\"_blank\" rel=\"noopener\">chmod manual page<\/a>.<\/p><p><strong>Mode <\/strong>is the new permissions for the file or folder, which you can write in<strong> symbolic<\/strong> or <strong>numeric <\/strong>notation. Both work the same way but have particular benefits, which we will explain in the following sections.<\/p><h3 class=\"wp-block-heading\" id=\"h-symbolic-mode\">Symbolic mode<\/h3><p>The symbolic method in chmod uses a single character representing the user class, permissions, and operations. Here&rsquo;s the list:<\/p><figure tabindex=\"0\" class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Symbol<\/strong><\/td><td><strong>Definition<\/strong><\/td><\/tr><tr><td>u<\/td><td>Owner<\/td><\/tr><tr><td>g<\/td><td>Group<\/td><\/tr><tr><td>o<\/td><td>Others<\/td><\/tr><tr><td>a<\/td><td>All user classes (owner, group, and others)<\/td><\/tr><tr><td>+<\/td><td>Add permissions<\/td><\/tr><tr><td>&ndash;<\/td><td>Remove permissions<\/td><\/tr><tr><td>=<\/td><td>Set permissions to the specified values<\/td><\/tr><tr><td>r, w, x<\/td><td>Permissions<\/td><\/tr><\/tbody><\/table><\/figure><p>The symbolic mode is more flexible and descriptive. It gives you more control when changing permissions, as you can edit specific privileges of a user class. Consider this example:<\/p><pre class=\"wp-block-preformatted\">chmod u+wx,g-x,o=r script.sh<\/pre><p>Let&rsquo;s break down the symbols to understand what it does:<\/p><ul class=\"wp-block-list\">\n<li><strong>u+wx <\/strong>&ndash; adds (<strong>+<\/strong>) write (<strong>w<\/strong>) and execute (<strong>x<\/strong>) permissions to the item&rsquo;s owner (<strong>u<\/strong>).<\/li>\n\n\n\n<li><strong>g-x <\/strong>&ndash; removes (<strong>&ndash;<\/strong>) the execute (<strong>x<\/strong>) permission over the file from the group (<strong>g<\/strong>).<\/li>\n\n\n\n<li><strong>o=r <\/strong>&ndash; sets (<strong>=<\/strong>) other users&rsquo; (<strong>o<\/strong>) permissions over the item to read-only (<strong>r<\/strong>).&nbsp;<\/li>\n<\/ul><p>For instance, if the file&rsquo;s initial permissions show as<strong> -r&ndash;rwxrwx<\/strong>, it will become <strong>-rwxrw-r&ndash;<\/strong>.<\/p><h3 class=\"wp-block-heading\" id=\"h-numeric-octal-mode\">Numeric (octal) mode<\/h3><p>The numeric mode uses three-digit numbers to determine the new permissions. The first digit represents the owner&rsquo;s permissions, the second is for the owner&rsquo;s group, and the third is for other users.<\/p><p>Here are the numbers and their definitions:<\/p><figure tabindex=\"0\" class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Number<\/strong><\/td><td><strong>Definition<\/strong><\/td><\/tr><tr><td>4<\/td><td>Read permission<\/td><\/tr><tr><td>2<\/td><td>Write permission<\/td><\/tr><tr><td>1<\/td><td>Execute permission<\/td><\/tr><tr><td>0<\/td><td>No permission<\/td><\/tr><\/tbody><\/table><\/figure><p>To set multiple permissions, simply add the numbers. For example, <strong>3 (1+2) <\/strong>makes an item executable and writable, while <strong>7 (1+2+4) <\/strong>will grant full privileges over the item.<\/p><p>For example, this command will set the<strong> script.sh<\/strong> file&rsquo;s permission to <strong>-rwxrw-r&ndash;<\/strong>:<\/p><pre class=\"wp-block-preformatted\">chmod 764 script.sh<\/pre><p>Numerical notation is more straightforward than symbolic. However, it is less flexible as you can&rsquo;t add or remove a certain permission, making it suitable for applying specific settings quickly.<\/p><p>Let&rsquo;s say an owner can read and write an item, but you want to make it executable. With symbolic, you can add the permission using <strong>u+x<\/strong>. Using numerical, you must add the existing privilege again using <strong>7 <\/strong>instead of only <strong>1<\/strong>.<\/p><h3 class=\"wp-block-heading\" id=\"h-recursive-permission-changes\">Recursive permission changes<\/h3><p>The chmod&rsquo;s <strong>-R<\/strong> option enables the recursive mode, which lets you set new permissions to a folder and all its content using a single command.<\/p><p>For example, we have a <strong>script <\/strong>folder containing the <strong>subscript1<\/strong> and<strong> subscript2<\/strong> subdirectories, as well as several <strong>.sh<\/strong> files. The structure looks as follows:<\/p><pre class=\"wp-block-preformatted\">script\/\n&#9474;\n&#9500;&#9472;&#9472; subscript\/\n&#9474;  &#9492;&#9472;&#9472; script1.sh\n&#9474;\n&#9500;&#9472;&#9472;subscript2\/\n&#9474;\n&#9500;&#9472;&#9472; script2.sh\n&#9474;\n&#9492;&#9472;&#9472; script3.sh<\/pre><p>Using recursive chmod, we can change permissions of all items above by simply modifying the <strong>script<\/strong> folder like so:<\/p><pre class=\"wp-block-preformatted\">chmod -R 777 script<\/pre><h2 class=\"wp-block-heading\" id=\"h-changing-ownership-with-chown-and-chgrp\">Changing ownership with chown and chgrp<\/h2><p>In Linux, if you create an item, you will be its owner by default. If you belong to a group, all other members will inherit the same permissions. You can change the ownership using the <strong>chown<\/strong> or <strong>chgrp<\/strong> command.<\/p><p>Chown is the more common command, which lets you change the ownership to both users and groups. The syntax looks as follows:<\/p><pre class=\"wp-block-preformatted\">chown [options] [user:group] [item]<\/pre><p>For example, if you want to change the ownership of <strong>script.sh<\/strong> to <strong>johndoe<\/strong>, who belongs to the <strong>admins<\/strong> group, use the following command:<\/p><pre class=\"wp-block-preformatted\">chown johndoe:admins script.sh<\/pre><p>To grant ownership to a new user while keeping the current group, simply omit the group name like so:<\/p><pre class=\"wp-block-preformatted\">chown johndoe script.sh<\/pre><p>Similarly, omit the user if you wish to change an item&rsquo;s ownership to another group. However, ensure to start the group name with a colon (<strong>:<\/strong>) similar to this:<\/p><pre class=\"wp-block-preformatted\">chown :admins script.sh<\/pre><p>The chown command also lets you add the <strong>-R<\/strong> option to change the item ownership recursively:<\/p><pre class=\"wp-block-preformatted\">chmod -R johndoe:admins scriptfolder<\/pre><p>Unlike chown, chgrp only lets you change an item&rsquo;s ownership to another group. Here&rsquo;s an example command:<\/p><pre class=\"wp-block-preformatted\">chgrp admins script.sh<\/pre><h2 class=\"wp-block-heading\" id=\"h-special-permission-bits\">Special permission bits<\/h2><p>In addition to read, write, and execute, Linux has additional permissions that give you more control over items on your system. This section will explain what they are and how to set them up.<\/p><h3 class=\"wp-block-heading\" id=\"h-setuid-and-setgid\">Setuid and setgid<\/h3><p><strong>Set user ID<\/strong> (setuid) permission lets you execute a file as the owner instead of the current user. You can add it using the <strong>s <\/strong>character of the symbolic notation like so:<\/p><pre class=\"wp-block-preformatted\">chmod u+s script.sh<\/pre><p>For example, if <strong>root <\/strong>is the owner of<strong> script.sh<\/strong>, executing the file will run it as <strong>root<\/strong> even if you are logged in as another user. This behavior is useful for launching a program as a specific user, especially during automation.<\/p><p>\n\n\n<div><p class=\"important\"><strong>Important!<\/strong><br>\nYour current user who will run the program must have the execute permission over the file. You can grant it by modifying the group or other user classes.<\/p><\/div>\n\n\n\n<\/p><p>After adding the <strong>s<\/strong> permission, the file owner&rsquo;s privilege should show as <strong>rws<\/strong>. It is essentially the same as <strong>rwx<\/strong>, but indicates that setuid is active. The correct setuid permission might look like this:<\/p><pre class=\"wp-block-preformatted\">-rwsr-xr-x<\/pre><p><strong>Set group ID <\/strong>(setgid) is similar to setuid, except it runs files using the associated group&rsquo;s permissions. To grant it, use the following command:<\/p><pre class=\"wp-block-preformatted\">chmod g+s script.sh<\/pre><p>Like setuid, the account that runs the file should have the execute permission as the owner or other users. Setgid permissions might look like this:<\/p><pre class=\"wp-block-preformatted\">-rwxr-sr-x<\/pre><p>When you create a new file inside a folder with setgid, the associated group will have ownership permission over it. Typically, your group will own the new file.<\/p><h3 class=\"wp-block-heading\" id=\"h-sticky-bit\">Sticky bit<\/h3><p>By default, all users with write permissions over a folder can rename and delete files inside it. This behavior is risky since they might accidentally remove important items.<\/p><p><strong>Sticky bit<\/strong> prevents this by disallowing users to delete or rename files unless they are the owner. Setting it up won&rsquo;t revoke the write permission, meaning users can modify the file&rsquo;s content.<\/p><p>To enable sticky bit on a folder, add the <strong>t<\/strong> permission using the chmod symbolic mode like so:<\/p><pre class=\"wp-block-preformatted\">chmod +t folder<\/pre><p>The <strong>t<\/strong> permission will replace other users&rsquo; execute privileges. Here&rsquo;s an example of a folder&rsquo;s permission with sticky bit enabled:<\/p><pre class=\"wp-block-preformatted\">drwxrwxrwt<\/pre><p>You can also add sticky bit recursively to all subfolders and files inside a folder by adding the<strong> -R<\/strong> option like so:<\/p><pre class=\"wp-block-preformatted\">chmod -R +t folder<\/pre><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>Setting the proper permissions and ownership of items is crucial for server security and functionality. In Linux, you can grant <strong>read,<\/strong> <strong>write<\/strong>, and <strong>execute<\/strong> permissions to three user classes: <strong>owner<\/strong>, <strong>group<\/strong>, and <strong>others<\/strong>.<\/p><p>To change permissions in Linux, use <strong>chmod <\/strong>followed by the settings and items you want to modify. For the setting, use symbolic notation if you want more flexibility in changing the permissions or numerical if you want a simpler command.<\/p><p>Meanwhile, use <strong>chown<\/strong> to change an item&rsquo;s ownership to another user or group. To modify the group ownership, you can also use the<strong> chgrp<\/strong> command.<\/p><p>In addition to the three permissions, Linux also has special ones. For example, <strong>setuid <\/strong>and <strong>setgid <\/strong>let you run a file as the owner or associated group. You can also add them using the <strong>chmod<\/strong> command.<\/p><h2 class=\"wp-block-heading\" id=\"h-change-permissions-linux-faq\">Change permissions Linux FAQ<\/h2><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1733916678452\"><h3 class=\"schema-faq-question\">What command is used to change permissions in Linux?<\/h3> <p class=\"schema-faq-answer\">To change a file or folder&rsquo;s permissions in Linux, use the <strong>chmod <\/strong>command. The syntax is <strong>chmod [option] [mode] [item]<\/strong>. Option modifies your command behavior, mode specifies the new permissions, while item refers to the file or folder you want to modify.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1733916699510\"><h3 class=\"schema-faq-question\">How do I view the current permissions of a file?<\/h3> <p class=\"schema-faq-answer\">To view the current permissions of a file, run <strong>ls -l filename<\/strong>, with filename being the actual name of the file you want to check. You can also run<strong> ls -l <\/strong>to see permissions of all files and folders in the current directory.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1733916710580\"><h3 class=\"schema-faq-question\">What does chmod stand for in Linux?<\/h3> <p class=\"schema-faq-answer\">In Linux, the <strong>chmod <\/strong>command stands for <strong>change mode<\/strong>. It lets you modify a file or folder&rsquo;s permission, allowing different users to read, write, or execute it.<\/p> <\/div> <\/div><h3 class=\"wp-block-heading\" id=\"h-\"><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>Properly managing Linux file permissions and ownership is essential for safety, especially when multiple administrators manage one server. Moreover, using the correct settings ensures your server can run properly. This article will explain how to change permissions and ownership in Linux. Before that, you will learn about the structure of item permissions and ownership on [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/my\/tutorials\/how-to-change-linux-permissions-and-owners\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":337,"featured_media":118890,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to change file permissions in Linux using chmod","rank_math_description":"To change permissions in Linux, run chmod followed by the new permission setting and the item you want to modify. Read on to learn more about it.","rank_math_focus_keyword":"change permissions linux","footnotes":""},"categories":[],"tags":[],"class_list":["post-665","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-change-linux-permissions-and-owners","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/changer-permissions-fichier-linux","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/cambiar-permisos-y-propietarios-linux-linea-de-comandos","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/pengertian-chmod-dan-chown-untuk-permission-di-linux","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-change-linux-permissions-and-owners","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-change-linux-permissions-and-owners","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-change-linux-permissions-and-owners","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/cambiar-permisos-y-propietarios-linux-linea-de-comandos\/","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/cambiar-permisos-y-propietarios-linux-linea-de-comandos\/","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/cambiar-permisos-propietarios-linux-traves-la-linea-comandos","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-change-linux-permissions-and-owners","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-change-linux-permissions-and-owners","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-change-linux-permissions-and-owners","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-change-linux-permissions-and-owners","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/665","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/users\/337"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/comments?post=665"}],"version-history":[{"count":28,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/665\/revisions"}],"predecessor-version":[{"id":120398,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/665\/revisions\/120398"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/media\/118890"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/media?parent=665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/categories?post=665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/tags?post=665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}