+2 votes
in Operating Systems by (73.8k points)

I have many users on my VM and want to give them RW access to a folder so that they all can read and write to the files present in the folder. chmod 777 foldername did not work for me. Any idea?

1 Answer

+2 votes
by (71.8k points)
selected by
 
Best answer

To give Read+Write access: sudo chmod -R a+rw foldername
To give Read+Write+Execute access: sudo chmod -R a+rwx foldername
-R, --recursive (change files and directories recursively).

Other options are as follows: (copied from man page of chmod)
       -c, --changes
              like verbose but report only when a change is made
       -f, --silent, --quiet
              suppress most error messages
       -v, --verbose
              output a diagnostic for every file processed
       --no-preserve-root
              do not treat '/' specially (the default)
       --preserve-root
              fail to operate recursively on '/'
       --reference=RFILE
              use RFILE's mode instead of MODE values
       -R, --recursive
              change files and directories recursively


...