Persist home user ssh keys into volume
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?
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
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.