What is the meaning of "chmod 666"?
I am using Linux. What is the meaning of chmod 666
?
chmod
command change attributes from a file/folder:
-
chmod 666 file/folder
means that all users can read and write but cannot execute the file/folder; -
chmod 777 file/folder
allows all actions for all users; -
chmod 744 file/folder
allows only user (owner) to do all actions; group and other users are allowed only to read.permission to: user(u) group(g) other(o) /¯¯¯\ /¯¯¯\ /¯¯¯\ octal: 6 6 6 binary: 1 1 0 1 1 0 1 1 0 what to permit: r w x r w x r w x binary - 1: enabled, 0: disabled what to permit - r: read, w: write, x: execute permission to - user: the owner that create the file/folder group: the users from group that owner is member other: all other users
Alternatively, you can execute the command with a more intuitive syntax, without needing to think in binary or octal (but the knowledge of numeric syntax is so important): chmod u=rw, g=rw, o=rw file/folder
Remember that the permission changes with chmod
command requires at least 3 arguments, so chmod 666
does nothing without explicit file/folder to change permissions.
Also be sure to criticize if it does not produce insecure issues or simply if it is an useless permission change, because chmod 666
will allow file/folder write to all and the execution to none.
As mentioned in other answers, chmod means change mode. It affects the read, write and executable permissions for the owner, group and other categories of users. The numbers that follow the command (in this case 666), indicate how those permissions are modified for the file the command is run on (for 666, it means that owner, group and other have read and write permissions, but no executable permissions).
By changing the numbers to different values you effectively change the permissions for the file. The link I've referenced above has a little tool for figuring out what values you need to put in to get the permissions scheme you're after. It also goes over the switch options available for the command and some examples to help you understand better how it works.
In really plain speak: it makes a file read- and write-able by the file owner, the file owner's group and every one else using the machine (all). Applied against a directory it lets everyone read (get file contents lists) of a directory and write (create, edit files in the directory) but not execute files from the directory.
For more detailed information how chmod
works check out this handy tutorial.
The chmod command (abbreviated from change mode) is a Unix command that lets an operator tell the system how much (or little) access it should permit to a file. Command chmod 666
means that all users will have read and write permissions.