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)
> | `-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)