summaryrefslogtreecommitdiff
path: root/ssh/entrypoint.sh
blob: c255adfc79842cc5d47cfb26122ecefde6bab915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
set -e
mkdir -p /repos /keys /home/git/.ssh /run/sshd
touch /keys/authorized_keys
chown -R git:git /home/git/.ssh 2>/dev/null || true
chmod 700 /home/git/.ssh
ssh-keygen -A
cat > /etc/ssh/sshd_config <<EOF
Port 22
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
AllowUsers git
AuthorizedKeysFile /keys/authorized_keys
X11Forwarding no
AllowTcpForwarding no
AllowAgentForwarding no
EOF
echo "sshd up · authorized_keys=/keys/authorized_keys (пишет бот)"
exec /usr/sbin/sshd -D -e