I tried to add SSH-key to the userkeys folder (in my case /home/docker/sftp/userkeys/foo.pub), but this results in no .ssh-folder is created in the user folder when I run ls -lah in /home/foo/.
As a temporary solution I did manage to make it work if i mounted a volume in the .ssh/keys folder manually (-v /home/docker/sftp/userkeys/:/home/foo/.ssh/keys/:ro).
I tried to add SSH-key to the userkeys folder (in my case /home/docker/sftp/userkeys/foo.pub), but this results in no .ssh-folder is created in the user folder when I run
ls -lah
in /home/foo/.As a temporary solution I did manage to make it work if i mounted a volume in the .ssh/keys folder manually (
-v /home/docker/sftp/userkeys/:/home/foo/.ssh/keys/:ro
).I think the issue is
createUser()
withauthorized_keys
generation: https://github.com/MarkusMcNugen/docker-sftp/blob/b6c5765df8b633ad265e8a3007040a55e02ca227/entrypoint#L119-L126...is executed before the userkeys folder copy script:
https://github.com/MarkusMcNugen/docker-sftp/blob/b6c5765df8b633ad265e8a3007040a55e02ca227/entrypoint#L201-L218
If I had the time, I wolud gladly help you out by do a pull request of the issue instead.