jupyterhub-deploy-docker icon indicating copy to clipboard operation
jupyterhub-deploy-docker copied to clipboard

Persist home user ssh keys into volume

Open priamai opened this issue 3 years ago • 1 comments

Proposed change

When user creates their own ssh keys to interact with gitlab they will be stored in the home .ssh hidden folder. I don't want the user to regenerate their ssh keys every time we restart the docker so I attempted this:

c.DockerSpawner.volumes = { 'jupyterhub-user-{username}': notebook_dir,'ssh-home-{username}':{'bind':'/home/jovyan/.ssh','mode':'ro'} }

However when I try to generate the keys:

(base) jovyan@c7a123167863:~$ ssh-keygen -t rsa -C "test"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/jovyan/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Saving key "/home/jovyan/.ssh/id_rsa" failed: Permission denied

I am not sure how should I set the permissions on the docker volume or elsewhere?

priamai avatar Feb 21 '22 12:02 priamai

This issue has been mentioned on Jupyter Community Forum. There might be relevant details there:

https://discourse.jupyter.org/t/permission-denied-on-ssh-keys/13107/1

meeseeksmachine avatar Feb 21 '22 12:02 meeseeksmachine

This was cross-posted to https://discourse.jupyter.org/t/permission-denied-on-ssh-keys/13107/3 The problem was resolved though no answer was given.

manics avatar Dec 05 '22 00:12 manics