I have a java application running on tomcat8. This application has a method for users to upload a public ssh key, which is then added to a local users authorized_keys (limited to scp on a single folder), so that they can use scp to the server using this one remote username.
The problem here is that tomact requires write access to the authorized_keys file. However sshd requires the permissions to be chmod 600.
How can I enable tomcat to write to the authorized_keys file and yet have the correct permissions for sshd to run. Alternatively I have thought of simply using the tomcat user as the scp user. however this feels like a bad idea.
Thanks for the Help Benedict
--- EDIT --- I have found out that I can give tomcat write permissions by deactivating StrictMode in sshd. I am not shure if this is a good idea?