Shared, writable folders in jupyterhub

烂漫一生 提交于 2019-12-03 07:15:17

问题


We are currently building a jupyterhub environment in a docker container and struggling with shared folders. Our goal is to set up a shared folder wich is writable for all users.

In each user's home folder there is a symbolic link ~/shared to /opt/shared. The target folder has the permissions 777 and is owned by the group jupyter. Each user is member of the group jupyter. However, if one user creates a file in the shared folder logged in with his account into the web app, the permissions are set to 644. Therefore, no other user can edit the file.

I've tried to set the umask to 000 in the /etc/profiles and the ~/.bashrc files for each user. However, jupyter seems to ignore it. Is there a possibility to configure jupyter to create new files with g+w rights as default? I would like to avoid setting up access control lists with setfacl at the file system level because it requires custom flags in the /etc/fstab.


回答1:


  1. Set a group (i.e., jupyter in your case) to shared folder chgrp jupyter /opt/shared
  2. Allow the group to write to that directory + make group sticky (new files are created with this group instead of user's primary group) chmod g+ws /opt/shared
  3. For each user create ~/.jupyter/jupyter_notebook_config.py

With following content:

  import os
  os.umask(0o002)

Newly created files will be writable by the group.



来源:https://stackoverflow.com/questions/35416116/shared-writable-folders-in-jupyterhub

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!