Skip to content

Commit

Permalink
Merge pull request #156 from nebari-dev/private-home
Browse files Browse the repository at this point in the history
Make user's home directories private
  • Loading branch information
aktech authored Apr 2, 2024
2 parents 60a99dc + 973e868 commit 5f39db4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
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

0 comments on commit 5f39db4

Please sign in to comment.