Chmod: Difference between revisions

From Psygen Wiki
Jump to navigation Jump to search
(Created page with "chmod manages file and directory permissions '''Example:''' <code>chmod 644 myfile.txt</code> == Common Settings == '''Files:''' 777 - (rwxrwxrwx) No restrictions...")
 
No edit summary
Line 9: Line 9:
'''Files:'''
'''Files:'''
      
      
    777 - (rwxrwxrwx) No restrictions on  permissions. Anybody may do anything.  Generally not a desirable setting.
777 - (rwxrwxrwx) No restrictions on  permissions. Anybody may do anything.  Generally not a desirable setting.
      
      
    755 - (rwxr-xr-x) The file's owner may  read, write, and execute the file. All others  may read and execute the file. This setting  is common for programs that are used by all  users.
755 - (rwxr-xr-x) The file's owner may  read, write, and execute the file. All others  may read and execute the file. This setting  is common for programs that are used by all  users.
      
      
    700 - (rwx------) The file's owner may  read, write, and execute the file. Nobody  else has any rights. This setting is useful  for programs that only the owner may use and  must be kept private from others.
700 - (rwx------) The file's owner may  read, write, and execute the file. Nobody  else has any rights. This setting is useful  for programs that only the owner may use and  must be kept private from others.
      
      
    666 - (rw-rw-rw-) All users may read and write the file.
666 - (rw-rw-rw-) All users may read and write the file.
      
      
    644 - (rw-r--r--) The owner may read and write a file, while all others may only read the file. A common setting for data files that everybody may read, but only the owner may change.
644 - (rw-r--r--) The owner may read and write a file, while all others may only read the file. A common setting for data files that everybody may read, but only the owner may change.
      
      
    600 - (rw-------) The owner may read and write a file. All others have no rights. A common setting for data files that the owner wants to keep private.
600 - (rw-------) The owner may read and write a file. All others have no rights. A common setting for data files that the owner wants to keep private.
      
      
'''Directories:'''
'''Directories:'''
      
      
    777 - (rwxrwxrwx) No restrictions on permissions. Anybody may list files, create new files in the directory and delete files in the directory. Generally not a good setting.
777 - (rwxrwxrwx) No restrictions on permissions. Anybody may list files, create new files in the directory and delete files in the directory. Generally not a good setting.
      
      
    755 - (rwxr-xr-x) The directory owner has full access. All others may list the directory, but cannot create files nor delete them. This setting is common for directories that you wish to share with other users.
755 - (rwxr-xr-x) The directory owner has full access. All others may list the directory, but cannot create files nor delete them. This setting is common for directories that you wish to share with other users.
      
      
    700 - (rwx------) The directory owner has full access. Nobody else has any rights. This setting is useful for directories that only the owner may use and must be kept private from others.
700 - (rwx------) The directory owner has full access. Nobody else has any rights. This setting is useful for directories that only the owner may use and must be kept private from others.

Revision as of 02:03, 21 December 2016

chmod manages file and directory permissions

Example:

chmod 644 myfile.txt

Common Settings

Files:

777 - (rwxrwxrwx) No restrictions on permissions. Anybody may do anything. Generally not a desirable setting.

755 - (rwxr-xr-x) The file's owner may read, write, and execute the file. All others may read and execute the file. This setting is common for programs that are used by all users.

700 - (rwx------) The file's owner may read, write, and execute the file. Nobody else has any rights. This setting is useful for programs that only the owner may use and must be kept private from others.

666 - (rw-rw-rw-) All users may read and write the file.

644 - (rw-r--r--) The owner may read and write a file, while all others may only read the file. A common setting for data files that everybody may read, but only the owner may change.

600 - (rw-------) The owner may read and write a file. All others have no rights. A common setting for data files that the owner wants to keep private.

Directories:

777 - (rwxrwxrwx) No restrictions on permissions. Anybody may list files, create new files in the directory and delete files in the directory. Generally not a good setting.

755 - (rwxr-xr-x) The directory owner has full access. All others may list the directory, but cannot create files nor delete them. This setting is common for directories that you wish to share with other users.

700 - (rwx------) The directory owner has full access. Nobody else has any rights. This setting is useful for directories that only the owner may use and must be kept private from others.