git-server-docker icon indicating copy to clipboard operation
git-server-docker copied to clipboard

Restart of docker container needed after adding key

Open rglas opened this issue 7 years ago • 2 comments

As a note, I had to restart the docker container after I copied my key. I'm using the latest tag on MacOS.

rglas avatar May 12 '17 08:05 rglas

You have reason, I forgot to mention it. I just update README.md with this information, very useful. Thanks a lot rglas!

jkarlosb avatar May 23 '17 20:05 jkarlosb

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.

dirkjonker avatar Dec 23 '17 22:12 dirkjonker