git-server-docker
git-server-docker copied to clipboard
Restart of docker container needed after adding key
As a note, I had to restart the docker container after I copied my key. I'm using the latest tag on MacOS.
You have reason, I forgot to mention it. I just update README.md with this information, very useful. Thanks a lot rglas!
You can prevent restarts by creating a small shell script, e.g.:
#!/bin/sh
cat /git-server/keys/*
Add the file to the container at a location like /usr/local/bin/keys.sh
Add the following options to sshd_config
:
AuthorizedKeysCommand /usr/local/bin/keys.sh
AuthorizedKeysCommandUser keyuser
You may want to create a user specifically for this command as is recommended in the sshd_config man page
Some additional scripting and/or configuration may be required to limit the key script to only work for the git
user.