I'm trying to set up remote access (with VSCode) to the GCP VM that's setup with Notebooks AI. However, when I ssh into the VM I don't have write permissions for /home/jupyter
so cannot edit any of the notebook files.
I have tried both gcloud compute ssh
and setting up local aliases with gcloud compute config-ssh
.
My best guess is that the users are different. It looks like the terminal on JupyterLab is logged in as jupyter@[instance...]
while when I ssh in its myname@[instance...]
. Checking permissions of /home/jupyter/
, it's owned by user jupyter
of group jupyter
. I also tried adding users to the jupyter
group with sudo usermod -a -G
but that didn't do the trick. When I try to ssh in as jupyter@[instance...]
from anywhere else I get permission denied (public key)
.
I can edit files once logged in if I use sudo vim ...
, but that won't help for VS code.
EDIT: a partial solution is to open up permissions using sudo chmod 777 /home/jupyter/*
. However, that's probably a hackish, unsafe way to do it. Moreover, it only works on existing files -- new files will still only be writable by whichever user created them.