Skip to content

Commit

Permalink
updated to fix some typos and give some superficial logic for how to …
Browse files Browse the repository at this point in the history
…build acl lists
  • Loading branch information
ebridge2 committed Jun 12, 2024
1 parent 9d09298 commit 7540a8e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
13 changes: 11 additions & 2 deletions labguide/computing/sherlock/access-and-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,19 @@ A useful and more interacrtive version of this command is `ncdu`.
To use `ncdu`, add the following line to the bottom of your `~/.bash_profile`, which will load the `ncdu` module each time you log in to Sherlock:

```bash
$ ml system ncdu
ml system ncdu
```

In future login session, you can access the `ncdu` command via
and then update your `~/.bash_profile` for the current session with:

```bash
$ source ~/.bash_profile
```

which will allow the current session to load the new module updated in your bash profile for `ncdu`.
For future login sessions, re-sourcing your `~/.bash_profile` is unnecessary.

In the present and future login sessions, you can access the `ncdu` command via:

```bash
$ ncdu <folder>
Expand Down
9 changes: 6 additions & 3 deletions labguide/computing/sherlock/data-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Datasets that are temporary, or files generated for analyses that are not intend
#### Restricting access

Some data resources cannot be shared across the lab and instead need to be restricted to lab members with Data Usage Agreement (DUA) access.
The following can be adapted to restrict ACLs (access control list) to only the appropriate subset of lab members:
This can be done via access control lists (ACLs), which allow a resource to be owned by a particular owner/group, but applies an additional more specific set of permissions.
The following can be adapted to restrict ACLs to an appropriate subset of lab members:

```{.bash filename="protect_access.sh"}
#!/bin/bash
Expand All @@ -36,11 +37,13 @@ fi

read -p "Enter the username: " user_name

# set restrictions
# set restrictions, repeating once for each desired user
echo -e "Setting restrictions for ${user_name} as rxw for folder: /n ${dir_name}"
setfacl -R -m u:$user_name:rwx $dir_name
setfacl -R -d -m u:$user_name:rwx $dir_name
# repeat the above commands, replacing $user_name with the usernames
# for additional members

# rm default permissions for the group -- oak_russpold
setfacl -m d::group:oak_russpold:--- $dir_name
```
```

0 comments on commit 7540a8e

Please sign in to comment.