2021-01-13 16:36:50 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2021-06-30 21:41:32 +00:00
|
|
|
# Generate host keys if none were found.
|
|
|
|
for t in rsa ecdsa ed25519; do
|
|
|
|
if test ! -f /etc/ssh/keys/ssh_host_${t}_key; then
|
|
|
|
ssh-keygen -q -t $t -f /etc/ssh/keys/ssh_host_${t}_key -C '' -N '' > /dev/null
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Create any missing directories.
|
2021-12-06 11:58:01 +00:00
|
|
|
mkdir -p /var/lib/git/.ssh /var/lib/git/public
|
2021-06-30 21:41:32 +00:00
|
|
|
|
2021-01-13 16:36:50 +00:00
|
|
|
# Correct permissions where needed.
|
2021-12-06 11:58:01 +00:00
|
|
|
chown -R git:git /var/lib/git /var/lib/git-serve
|
|
|
|
chown -R git-public:git /var/lib/git/public
|
|
|
|
|
|
|
|
chmod -R u+rwX,go-rwxX /var/lib/git && chmod g+X /var/lib/git
|
|
|
|
chmod -R ug+rwX /var/lib/git/public
|
|
|
|
|
2021-06-30 21:41:32 +00:00
|
|
|
chmod 0644 /etc/ssh/keys/ssh_host_*_key.pub
|
|
|
|
chmod 0600 /etc/ssh/keys/ssh_host_*_key
|
2021-01-13 16:36:50 +00:00
|
|
|
|
|
|
|
# Run SSH daemon.
|
|
|
|
/usr/sbin/sshd -D -e
|