sshfs does not seem to work in Colab Enterprise notebook

127 views Asked by At

I've been trying to use sshfs to connect a notebook running in Colab Enterprise to my local machine (running an ssh server) and mount a local directory into the remote Runtime. But I get the error fuse: mount failed: Permission denied even before the SSH connection is even attempted.

I'm running as root, connecting to the SSH server as another user (i.e. sshfs someuser@ip ), and my mount point (in the notebook runtime) exists and is owned by root. What could be happening here ?

2

There are 2 answers

0
gogasca On BEST ANSWER

There was an internal feature request to allow Mount of Fuse systems into Colab Runtime, I submitted the fix and will rollout to production next week. (By Friday 1st should be in all regions)

0
gogasca On

I tried GCSfuse and worked fine, please try SSHfs which should work as well.

Example:

!export GCSFUSE_REPO=gcsfuse-`lsb_release -c -s`
# This returns gcsfuse-jammy. Replace manually

!echo "deb https://packages.cloud.google.com/apt gcsfuse-jammy main" | sudo tee /etc/apt/sources.list.d/gcsfuse.list
!curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -

!sudo apt-get update
!sudo apt-get install gcsfuse

# Create a local directory. Here you will mount GCSfuse. (GCS bucket is: $BUCKET_NAME)

!mkdir gcs-bucket-mount
!gcsfuse --implicit-dirs $BUCKET_NAME gcs-bucket-mount
{"time":"07/12/2023 12:05:39.597680","severity":"INFO","msg":"Start gcsfuse/1.2.1 (Go version go1.21.3) for app \"\" using mount point: /content/gcs-bucket-mount\n"}