MarkusMcNugen / docker-sftp

Fork of atmoz SFTP container built with Ubuntu and includes fail2ban
MIT License
17 stars 8 forks source link

SSH-keys not working #2

Closed walle89 closed 6 years ago

walle89 commented 6 years ago

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()with authorized_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.

walle89 commented 6 years ago

Pull request #1 fixed it. Closing this issue.