Skip to content
Snippets Groups Projects
Unverified Commit cdbe8741 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

add summary of cmd used

parent 89ba3848
No related branches found
No related tags found
No related merge requests found
...@@ -161,4 +161,11 @@ What append ? ...@@ -161,4 +161,11 @@ What append ?
You can use the `-l` option in combination with the `-a` option to know more about those folders. You can use the `-l` option in combination with the `-a` option to know more about those folders.
> We have seen the commands :
>
> - `cal` for calendar
> - `cd` for change directory
> - `ls` for list directory
> - `pwd` for print working directory
[You can now go to the Unix file system.](http://perso.ens-lyon.fr/laurent.modolo/unix/4_unix_file_system.html) [You can now go to the Unix file system.](http://perso.ens-lyon.fr/laurent.modolo/unix/4_unix_file_system.html)
\ No newline at end of file
...@@ -222,4 +222,11 @@ mount ...@@ -222,4 +222,11 @@ mount
Find which disk is mounted at the root of the file tree. Find which disk is mounted at the root of the file tree.
> We have seen the commands:
>
> - `stat` to display information on a file
> - `less` to visualise the content of a file
> - `ln` to create link
> - `mount` to list mount points
[That’s all for the Unix file system, we will come back to it from time to time but for now you can head to the next section.](http://perso.ens-lyon.fr/laurent.modolo/unix/5_users_and_rights.html) [That’s all for the Unix file system, we will come back to it from time to time but for now you can head to the next section.](http://perso.ens-lyon.fr/laurent.modolo/unix/5_users_and_rights.html)
\ No newline at end of file
...@@ -14,7 +14,7 @@ GNU/Linux and other Unix-like OS are multiuser, this means that they are designe ...@@ -14,7 +14,7 @@ GNU/Linux and other Unix-like OS are multiuser, this means that they are designe
There is always at least one user: the **root** user There is always at least one user: the **root** user
- It’s the super user - It’s the super user
- he has every right (we can say that he ignores the right system) - he has every right (we can say that he ignores the rights system)
- this account should only be used to administer the system. - this account should only be used to administer the system.
There can also be other users who There can also be other users who
...@@ -80,6 +80,24 @@ chmod u-x,g-w,o= .bashrc ...@@ -80,6 +80,24 @@ chmod u-x,g-w,o= .bashrc
What can you conclude on the symbols `+` , `=`, `-` and `,` with the `chmod` command ? What can you conclude on the symbols `+` , `=`, `-` and `,` with the `chmod` command ?
> ### Numeric notation
>
> Another method for representing Unix permissions is an [octal](https://en.wikipedia.org/wiki/Octal) (base-8) notation as shown by `stat -c %a`.
>
> | Symbolic notation | Numeric notation | English |
> | ------------------ | ----------------- | ------------------------------------------------------------ |
> | `----------` | 0000 | no permissions |
> | `-rwx------` | 0700 | **read, write, & execute only for owner** |
> | `-rwxrwx---` | 0770 | read, write, & execute for owner and group |
> | `-rwxrwxrwx` | 0777 | read, write, & execute for owner, group and others |
> | `---x--x--x` | 0111 | execute |
> | `--w--w--w-` | 0222 | write |
> | `--wx-wx-wx` | 0333 | write & execute |
> | `-r--r--r--` | 0444 | read |
> | `-r-xr-xr-x` | 0555 | read & execute |
> | `-rw-rw-rw-` | 0666 | read & write |
> | `-rwxr-----` | 0740 | owner can read, write, & execute; group can only read; others have no permissions |
The default group of your user is the first in the list of the groups you belong to. You can use the command `groups` to display this list. What is your default group ? The default group of your user is the first in the list of the groups you belong to. You can use the command `groups` to display this list. What is your default group ?
When you create an empty file, system default rights and your default groups are used. You can use the command `touch` to create a file. When you create an empty file, system default rights and your default groups are used. You can use the command `touch` to create a file.
...@@ -140,7 +158,7 @@ The command `cp` allows you to **c**o**p**y file from one destination to another ...@@ -140,7 +158,7 @@ The command `cp` allows you to **c**o**p**y file from one destination to another
man cp man cp
``` ```
Copy the `mkdir` tool to your home directory. Can you remove execution rights for the others on your copy of `mkdir` ? Copy the `mkdir` tool to your home directory. Can you remove execution rights for the others on your copy of `mkdir` ? Can you read the contentof the `mkdir` file ?
You cannot change the owner of a file, but you can always allow another user to copy it and change the rights on its copy. You cannot change the owner of a file, but you can always allow another user to copy it and change the rights on its copy.
...@@ -239,8 +257,22 @@ Check the results. ...@@ -239,8 +257,22 @@ Check the results.
## Security-Enhanced Linux ## Security-Enhanced Linux
While what you have seen in this section hold true for every Unix system, additional rules can be applied to control the rights in Linux. This is what is called [SE Linux](https://en.wikipedia.org/wiki/Security-Enhanced_Linux) (**s**ecurity-**e**nhanced **Linux**) While what you have seen in this section hold true for every Unix system, additionnal rules can be applied to control the rights in Linux. This is what is called [SE Linux](https://en.wikipedia.org/wiki/Security-Enhanced_Linux) (**s**ecurity-**e**nhanced **Linux**)
When SE Linux is enabled on a system, every **process** can be assigned a set of right. This is how, on Android for example, some programs can access your GPS while other cannot, etc. In this case it's not the user rights that prevail, but the **process** launched by the user. When SE Linux is enabled on a system, every **processes** can be assigned a set of right. This is how, on Android for example, some programs can access your GPS while other cannot etc. In this case it's not the user rights that prevail, but the **process** launched by the user.
> We have seen the commands:
>
> - `chmod` to change rights
> - `touch` to create an empty file
> - `mkdir` to create a directory
> - `chgrp` to change associated group
> - `chown` to change owner
> - `man` to display the manual
> - `cp` to copy files
> - `sudo` to borrow **root** rights
> - `groupadd` to create groups
> - `groups` to list groups
> - `usermod`to manipulate user's to groups
[To understand more about processes you can head to the next section.](https://http://perso.ens-lyon.fr/laurent.modolo/unix/6_unix_processes.html) [To understand more about processes you can head to the next section.](https://http://perso.ens-lyon.fr/laurent.modolo/unix/6_unix_processes.html)
\ No newline at end of file
../img
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment