This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
os_cp:users_permissions [2026/03/17 14:11] jkonczak |
os_cp:users_permissions [2026/03/18 21:56] (current) jkonczak [Changing permissions, group and owner of a file] |
||
|---|---|---|---|
| Line 334: | Line 334: | ||
| The ''chmod'', <small> ''chgrp'' and ''chown'' </small> commands accept switches ''-R'' (''--recursive'') and ''--reference=//file//'' (to clone the permission/<small>group/owner</small> from the referenced file). | The ''chmod'', <small> ''chgrp'' and ''chown'' </small> commands accept switches ''-R'' (''--recursive'') and ''--reference=//file//'' (to clone the permission/<small>group/owner</small> from the referenced file). | ||
| - | //Do the exercises on the SSH server indicated during classes (''ssh user//N//@fe80::1%br0''). | + | //Do the exercises on the SSH server indicated during classes (''ssh user//N//@fe80::1%br0''). |
| \\ To create files, you may use e.g., the // ''fortune > //file//'' //command.// | \\ To create files, you may use e.g., the // ''fortune > //file//'' //command.// | ||
| + | |||
| + | <small> | ||
| + | ++++ Instructions for using your own Linux box to do the exercises | | ||
| + | To do the exercises on your own computer, you may either: | ||
| + | - Use the following commands to add sample groups and users to your system:<code bash> | ||
| + | groupadd even | ||
| + | groupadd odd | ||
| + | groupadd low | ||
| + | groupadd high | ||
| + | useradd -g odd -G low -m user1 | ||
| + | useradd -g even -G low -m user2 | ||
| + | useradd -g odd -G high -m user3 | ||
| + | useradd -g even -G high -m user4 | ||
| + | passwd -d user1 | ||
| + | passwd -d user2 | ||
| + | passwd -d user3 | ||
| + | passwd -d user4</code> | ||
| + | - Build & use {{so:users_chmod:container-for-file-permission-labs.tar.xz|a docker image}} (provided you're familiar with docker), e.g., using the commands:<code bash> | ||
| + | curl -s https://www.cs.put.poznan.pl/jkonczak/_media/so:users_chmod:container-for-file-permission-labs.tar.xz | tar xJ | ||
| + | docker build --tag container-for-file-permission-labs container-for-file-permission-labs | ||
| + | docker run --network=none --rm -ti container-for-file-permission-labs</code> | ||
| + | ++++ | ||
| + | </small> | ||
| ~~Exercise.#~~ Create a file. Set the file permissions so that only the user can read the file. | ~~Exercise.#~~ Create a file. Set the file permissions so that only the user can read the file. | ||