diff --git a/content/blog/gitea.md b/content/blog/gitea.md index bd70359..21246e0 100644 --- a/content/blog/gitea.md +++ b/content/blog/gitea.md @@ -1,5 +1,5 @@ --- -title: "Replicating Gitea Docker SSH Passthrough on k8s" +title: "Replicating Gitea Docker SSH Passthrough on K8s" date: "2023-02-12" --- @@ -49,5 +49,21 @@ Match User git AuthorizedKeysCommand /usr/local/bin/kubectl exec -i -n gitea gitea-0 -c gitea -- /usr/local/bin/gitea keys -e git -u %u -t %t -k %k {{< / highlight >}} -If you are using AllowUsers directive don't forget to add user git +If you are using `AllowUsers` directive don't forget to add user git +## Testing + +Open Gitea in web browser and add you SSH key. Then try to SSH into the Gitea container. + +{{< highlight bash >}} +ssh git@ +{{< / highlight >}} + +You should get a message like this: + +> PTY allocation request failed on channel 0 +> Hi there, test! You've successfully authenticated with the key named , but Gitea does not provide shell access. +> If this is unexpected, please log in with password and setup Gitea under another user. +> Connection to closed. + +Now you can create a repo and you should be able to clone and push via SSH.