Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make user's home directories private #156

Merged
merged 3 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
# Frequently Asked Questions

Q1: Can a user access another user's home directory in JupyterLab?

No. Every user's home directory is private to themselves and they cannot access contents
of any other user's home directory. Example below shows the permissions of user directories
in `/home`.

```bash
$ ls -ltrh /home

total 36K
drwx------ 9 john-doe example-user 4.0K Apr 1 19:22 john-doe
drwx------ 9 alice-doe example-user 4.0K Apr 1 19:34 alice-doe
```

```bash
john-doe@worker-01:~$ pwd
/home/john-doe

# The user john-doe unable to access contents of user alice-doe's home directory:
john-doer@worker-01:~$ ls /home/alice-doe/
ls: cannot open directory '/home/alice-doe/': Permission denied
```
5 changes: 5 additions & 0 deletions roles/jupyterhub/templates/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ class QHubHPCSpawner(QHubHPCSpawnerBase):
ln -s /shared "$HOME/share"
fi

echo "Ensure home directory $HOME is private"
# This will remove read, write, execute permissions from the group and other users.
# It will not change permissions for the user that owns the file.
chmod go-rwx $HOME

# ensure ipyparallel configuration profiles
cp -r /etc/jupyter/profile_default $HOME/.ipython/

Expand Down
Loading