Skip to content

Commit 8b199cf

Browse files
committed
add tutorial on changing file permissions on SURF
1 parent a5e04ad commit 8b199cf

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
"user-guide/tutorials/surf_research_cloud_setup": "user-guide/_images/freepik_research_vessel.jpg",
8585
"user-guide/tutorials/working_with_expedition_yaml": "user-guide/_images/AnnaWeber.jpeg",
8686
"user-guide/teacher-content/UU-dyoc/example_expedition": "user-guide/_images/AnnaWeber.jpeg",
87+
"user-guide/teacher-content/UU-dyoc/file_permissions": "user-guide/_images/AnnaWeber.jpeg",
8788
}
8889

8990
sphinx_gallery_conf = {"default_thumb_file": "_static/virtual_ship_logo.png"}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# File Permissions on the SURF RC Virtual Machine
2+
3+
The shared storage directory in the SURF RC virtual machine (e.g. `data/virtualship-storage/`) is configured such that all users of the workspace can read and access the files within it, but only the owner of a file can edit it. This can prevent seamless collaboration on the same expedition content, for example within your group.
4+
5+
## How to share and edit files within the shared storage
6+
7+
To enable collaboration on expedition content within your group, you can change the permissions of files within the shared storage directory to allow editing by all users. This can be done using the `chmod` command in the terminal (see [here](https://en.wikipedia.org/wiki/Chmod) for more detail on the `chmod` command).
8+
9+
For example, for your `expedition.yaml` file, you can run the following command in the terminal (after navigating to your group's directory and replacing `EXPEDITION_NAME` with your actual expedition directory):
10+
11+
```
12+
chmod 777 /EXPEDITION_NAME/expedition.yaml
13+
```
14+
15+
This will allow _all_ users in the SURF environment to edit the `expedition.yaml` file. You can repeat this process for any other files within the shared storage that you wish to collaborate on with your group members.
16+
17+
```{warning}
18+
Be careful when using `chmod 777`, as it grants read, write, and execute permissions to **all** users. This means _everyone_ who has access to the SURF environment can edit the file (i.e. the whole class), which could cause accidental changes or deletions if not used carefully. We recommend you make backups of important files before changing permissions.
19+
20+
This is generally fine for the purposes of this unit where the virtual environment is a controlled setting, but in other contexts, it can pose security risks. Always ensure you understand the implications of changing file permissions and consider more restrictive permissions when necessary.
21+
22+
**TL;DR the `chmod 777` command is fine for this unit, but be very careful when using it in other contexts!**
23+
```
24+
25+
## Reverting the file permissions
26+
27+
If you wish to revert the file permissions back to only allowing the owner to edit, you can run the following command in the terminal:
28+
29+
```
30+
chmod 644 /EXPEDITION_NAME/expedition.yaml
31+
```

docs/user-guide/teacher-content/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ UU-ocean-of-future/plot_slider.py
4040
caption: UU Dynamical Oceanography
4141
---
4242
UU-dyoc/example_expedition.md
43+
UU-dyoc/file_permissions.md
4344
```

0 commit comments

Comments
 (0)