Permission denied on ssh keys

Hi there,
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?

Original post: Persist home user ssh keys into volume · Issue #113 · jupyterhub/jupyterhub-deploy-docker · GitHub

You’ve mounted it as read-only.

If you still have problems can you run ls -ld /home/jovyan/.ssh?

I actually found the issue the mode was just part of that, will post my notes here.