Advertisement
v1ral_ITS

notes on chmod file ownership

Jul 20th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.12 KB | None | 0 0
  1.  
  2. You can give permission to folder and all its contents using option -R i.e Recursive permissions.
  3.  
  4. But I would suggest not to give 777 permission to all folder and it's all contents. You should give specific permission to each sub-folder in www directory folders.
  5. Ideally give 755 permission for security reasons to web folder.
  6.  
  7. sudo chmod -R 755 /www/store
  8.  
  9. Each number have meaning in permission. Do not give full permissions.
  10.  
  11. N   Description                      ls   binary    
  12. 0   No permissions at all            ---  000
  13. 1   Only execute                     --x  001
  14. 2   Only write                       -w-  010
  15. 3   Write and execute                -wx  011
  16. 4   Only read                        r--  100
  17. 5   Read and execute                 r-x  101
  18. 6   Read and write                   rw-  110
  19. 7   Read, write, and execute         rwx  111
  20.  
  21.    First Number 7 - Read, write, and execute for user.
  22.    Second Number 5 - Read and execute for group.
  23.    Third Number 5 - Read and execute for other.
  24.  
  25. If your production web folder have multiple users, then you can set permissions and user groups accordingly.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement