Chmod Command Permissions

4 min


This blog post is all about Chmod Command. Chmod command is a Unix command that changes the access permissions of files and directories so they can be read, written to or executed by a user on the system.

Chmod Command has been around since 1979 and you can use it in both Linux and Windows. In this article we will talk about Chmod Command basics, how to use Chmod Command in different situations, how to find help when you need it most with Chmod Command, some additional resources for learning more about Chmods commands as well as what the future holds for Chmods Commands development. Chmod Command Basics Chmods commands syntax is very easy to understand and use. Chmod Commands basic usage can be understood easily by looking at some examples: chmods -R 777 /home/user/file means that all files in directory ‘’’/home/user/file”’ will have full permissions (read, write and execute, owner, group and all others). Chmods Command example: chmod g+w file.txt will give the group write permission to ‘’file.txt”’. Chmods Commands -R option means recursive which means it is working on files in subfolders (files inside folders)

What is Chmod Command?

Chmod Command Help Chmod commands are one of the most popular and frequently used Unix commands. Chmod command can be a little daunting at first, but with a little practice it becomes very easy to use. Chmod command help is available through different resources, including online manuals, man pages and articles like this one. Chmod Command in Different Situations Chmods commands are versatile and can

The Chmod command, is used to give or change file permissions on linux, using either a symbolic or numeric mode or a reference file.

Some of the most common chmod file permissions are given below.

Chmod r permission

Chmod file permission r, Gives read permissions. The file can be opened, and its content viewed.

Chmod w permission

Chmod file permission w, Gives write permissions. The file can be edited, modified, and deleted

Chmod x permission

Chmod file permission x, Gives execute permissions. If the file is a script or a program, it can be run (executed).

Chmod Combination Permission

Sometimes you can give combination permission to the files:

For example:

  •  rwx means full permissions have been granted. The read, write, and execute indicators are all present.
  • --- means no permissions have been granted at all.

Chmod 777

Chmod 777 is a chmod command that gives file permission to a file or folder to be readable, writable and executable by all users.

Giving 777 permission to a file or folder can become a huge security risk, most especially, if the file and folder holds sensitive script and files.

Chmod 775

Chmod 775 command gives assigns read, write, and execute permission to a specific user, group, or others.

Chmod 770

Chmod 770 gives  read and write (rw-) permission for the owner (you), but read-only (r–) permission for the group members, and no access permissions for others

Chmod 755

Chmod 755 is a chmod command that gives read and execute file permisssion on file or folder to everybody

Chmod 744

Chmod 744 (chmod a+rwx,o-wx) sets permissions so that, the admin user or owner can read, write and execute. Sudo group read, write and execute. Other normal users can read, can’t write and can’t execute.

Chmod 644

Chmod 644, (chmod a+rwx,u-x,g-wx,o-wx) sets permissions so that, the admin user or owner can read, write and can’t execute. (G)roup can read, can’t write and can’t execute. While others can read, can’t write and can’t execute.

Chmod 600

Chmod 600 (chmod a+rwx,u-x,g-rwx,o-rwx) sets permissions so that, the admin user or owner can read, can write and can’t execute. Sudo group can’t read, can’t write and can’t execute. While others can’t read, can’t write and can’t execute.

Chmod 666

Chmod 666, (chmod a+rwx,u-x,g-x,o-x) sets permissions so that, the admin user or owner can read, can write and can’t execute. Sudo group can read, can write and can’t execute. While others can read, can write and can’t execute.

Chmod 400

Chmod 400 (chmod a+rwx,u-wx,g-rwx,o-rwx) sets permissions so that, the admin user or owner can read, can’t write and can’t execute. Sudo group can’t read, can’t write and can’t execute. While others can’t read, can’t write and can’t execute.

Chmod 0777

Chmod 0777, (chmod a+rwx,ug-s,-t) sets permissions so that, the admin user or owner can read, can write and can execute. Sudo group can read, can write and can execute. (O)thers can read, can write and can execute.

Chmod 0777 vs 777: If you’re passing them to chmod (the command-line program), there is no difference. But in a C program or similar, 0777 is octal (three sets of three 1 bits, which is what you intend), while 777 is decimal, and it’s quite a different bit pattern. (chmod will interpret any numeric argument as octal, hence no leading zero is necessary.)

Chmod 664

Chmod 664 (chmod a+rwx,u-x,g-x,o-wx) sets permissions so that, the admin user or owner can read, can write and can’t execute. Sudo group can read, can write and can’t execute. While others can read, can’t write and can’t execute.

Chmod 0755

Similar to Chmod 755, the chmod 0755, basically does the same thing. The Chmod 0755 command, (chmod a+rwx,g-w,o-w,ug-s,-t) sets permissions so that, the admin user or owner can read, can write and can execute. Group can read, can’t write and can execute. While others can read, can’t write and can execute.

Chmod 444

Chmod 444 basically (chmod a+rwx,u-wx,g-wx,o-wx) sets permissions so that, the admin user or owner can read, can’t write and can’t execute. Group can read, can’t write and can’t execute. While others can read, can’t write and can’t execute.

Chmod 555

Chmod 555 (chmod a+rwx,u-w,g-w,o-w) sets permissions so that, the admin user or owner can read, can’t write and can execute. Group can read, can’t write and can execute. While others can read, can’t write and can execute.

Chmod 4755

Chmod 4755 (chmod a+rwx,g-w,o-w,ug+s,+t,g-s,-t) sets permissions so that, the admin user or owner can read, can write and can execute. Group can read, can’t write and can execute. While others can read, can’t write and can execute.

Chmod 0600

Chmod 0600 (chmod a+rwx,u-x,g-rwx,o-rwx,ug-s,-t) sets permissions so that, admin user or owner can read, can write and can’t execute. Group can’t read, can’t write and can’t execute. While others can’t read, can’t write and can’t execute.

Chmod 7777

Chmod 7777 (chmod a+rwx,ug+s,+t) sets permissions so that, admin user or owner can read, can write and can execute. Group can read, can write and can execute. While others can read, can write and can execute.

Chmod 2700

Chmod 2700 (chmod a+rwx,o-rwx,ug+s,+t,u-s,-t) sets permissions so that, admin user or owner can read, can write and can execute. Group can read, can write and can execute. While others can’t read, can’t write and can’t execute.

Chmod 2755

Chmod 2755 (chmod a+rwx,g-w,o-w,ug+s,+t,u-s,-t) sets permissions so that, admin user or owner can read, can write and can execute. Group can read, can’t write and can execute. While others can read, can’t write and can execute.

See Also:

How to Setup Email on DigitalOcean

Chmod Comman Permissions

How to Add Sudo User in Ubuntu and Linux with Root Privileges

References

  1. https://www.pluralsight.com/blog/it-ops/linux-file-permissions
  2. https://www.howtogeek.com/437958/how-to-use-the-chmod-command-on-linux/
  3. https://www.computerhope.com/unix/uchmod.htm
  4. https://cets.seas.upenn.edu/answers/chmod.html
  5. https://www.geeksforgeeks.org/chmod-command-linux/
  6. https://www.tutorialspoint.com/unix/unix-file-permission.htm
  7. Chmod 774 (chmodcommand.com)

0 Comments