diff --git a/cloud-init.sh.tftpl b/cloud-init.sh.tftpl
index 4b9621a49f9ac48a30710a920119e0e16a8f0e04..2b4d6de68d30eee4e159f0a6d028bdf6fed2e973 100644
--- a/cloud-init.sh.tftpl
+++ b/cloud-init.sh.tftpl
@@ -7,6 +7,7 @@
   echo 'ci ALL=(ALL) NOPASSWD:ALL' >/etc/sudoers.d/90-ci
   mkdir -p -m 700 ~ci/.ssh
   echo ${SSH_PUBLIC_KEY} >>~ci/.ssh/authorized_keys
+  chown -R ci:ci ~ci/.ssh
   # GitLab needs a recent version of `gitlab-runner` to be compatible with
   # the instance running on gitlab.inria.fr. The version packaged by default
   # on Ubuntu is regularly out of date.