yuvipanda / jupyterhub-ssh

SSH Access to JupyterHubs
BSD 3-Clause "New" or "Revised" License
96 stars 29 forks source link

sftp mounting issues #69

Closed aurany closed 2 years ago

aurany commented 2 years ago

Hi,

I'm running the sftp-image as a separate container on the same server as JupyterHub which is also a container. I have started the sftp container but having some trouble to login. After doing some research i created a debug logfile to see that the user validation actually is ok. The problem seems to be the mounting that happens inside the jupyterhub-token-verify.py

What should theese variables be?

SRC_DIR = PosixPath("/mnt/home")
DEST_DIR = PosixPath("/export/home") 

From the logfile (server and username are replaced by SERVER and USERID)

root@SERVER:/# cat /tmp/debug.log
*** Tue Feb 22 21:25:01 2022
mount: /export/home/USERID/USERID: permission denied.
/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py:1013: InsecureRequestWarning: Unverified HTTPS request is being made to host 'SERVER'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
  warnings.warn(
Traceback (most recent call last):
  File "/usr/sbin/jupyterhub-token-verify.py", line 154, in <module>
    bind_mount_user(untrusted_username)
  File "/usr/sbin/jupyterhub-token-verify.py", line 134, in bind_mount_user
    subprocess.check_call(["mount", "-o", "bind", src_path, dest_bind_path])
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['mount', '-o', 'bind', PosixPath('/mnt/home/USERID'), PosixPath('/export/home/USERID/USERID')]' returned non-zero exit status 32.
aurany commented 2 years ago

The problem was that i had the wrong SRC_PATH.