Updating tutorial chown

This commit is contained in:
Jose 2022-09-09 18:07:04 -03:00
parent 3f623da9d2
commit d2044072d1
1 changed files with 27 additions and 4 deletions

View File

@ -56,9 +56,9 @@ contains multiple subdirectories. Let's call that directory "buds"
I can't access the files without being `root`. This is the outuput in the I can't access the files without being `root`. This is the outuput in the
command line When a list the directory using `ls -la`. command line When a list the directory using `ls -la`.
#+begin_example bash #+begin_example bash
drw-r--r-- 81 user user 4096 dec 26 06:21 buds drw-r--r-- 81 user user 4096 dec 26 06:21 buds
#+end_example #+end_example
When I go to my git repository and check the change I can see this output for When I go to my git repository and check the change I can see this output for
@ -80,6 +80,23 @@ access the files
chmod -R o=wxr,g=xr, o=x buds chmod -R o=wxr,g=xr, o=x buds
#+end_src #+end_src
This will change the permissions for:
* The owner (4 = read; 2 = write; 1 = execute)
* The group (4 = read) and
* Others (4 = read)
Use ~-R~ if you want to apply recursive ~chmod~
#+begin_src bash
chmod 744 NameOfFileHere
#+end_src
Think of the following code: what does that code do?
#+begin_src bash
chmod -R 755 NameOfFileHere
#+end_src
*** The output now is: *** The output now is:
@ -96,9 +113,15 @@ Remember how it looks before
But I still can open the files. That is because need to change the owner: But I still can open the files. That is because need to change the owner:
#+begin_example bash #+begin_example bash
chown -R 755 buds # Try this and check the result chown NameOfownerHere buds # Try this and check the result
chown -R user buds # Then try this and check the result
#+end_example #+end_example
Include the owner then ~:~ and then the name of the group to change ownership for each one of those users
#+begin_example bash
chown user:usergroup buds # Then try this and check the result
#+end_example
ps: should use`sudo` to run this command, so be careful and make a scratch directory ps: should use`sudo` to run this command, so be careful and make a scratch directory
to run tests. to run tests.