diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c0ffa4c3b4b18e537214253480d45c814e2e4811..5f46cf135938b35e44e5bb58bd70e0da3f810441 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -30,6 +30,7 @@ linux_27:
   <<: *build_job
   variables:
     PYTHON_VERSION: "2.7"
+    GITLAB_CHECKOUT_STRATEGY: "https://gitlab-ci-token:${CI_BUILD_TOKEN}@gitlab.idiap.ch/"
   tags:
     - docker
   image: continuumio/conda-concourse-ci
@@ -38,6 +39,7 @@ linux_36:
   <<: *build_job
   variables:
     PYTHON_VERSION: "3.6"
+    GITLAB_CHECKOUT_STRATEGY: "https://gitlab-ci-token:${CI_BUILD_TOKEN}@gitlab.idiap.ch/"
   tags:
     - docker
   image: continuumio/conda-concourse-ci
diff --git a/scripts/rebuild.sh b/scripts/rebuild.sh
index 3f23d7d0aec0f79cf3b0a0da728697b5e55d696f..3eb1d94e5b7bb94cb0d6f6dc28f24232e47a5386 100755
--- a/scripts/rebuild.sh
+++ b/scripts/rebuild.sh
@@ -23,7 +23,7 @@ CI_COMMIT_REF="${CI_COMMIT_REF:-12345678}"
 CI_COMMIT_REF_NAME="${CI_COMMIT_REF_NAME:-@local}"
 
 # The way to clone the repositories for this build
-GITLAB_CHECKOUT_STRATEGY="git@gitlab.idiap.ch:"
+GITLAB_CHECKOUT_STRATEGY="${GITLAB_CHECKOUT_STRATEGY:-git@gitlab.idiap.ch\:}"
 
 # Overrides some stuff
 if [ "${CI_COMMIT_REF_NAME}" == "@local" ]; then
@@ -34,12 +34,6 @@ fi
 source ${basedir}/_ci/functions.sh
 unset BOB_PACKAGE_VERSION
 
-# If we build inside a Docker container, disables strict ssh key checking
-if [[ "${OS_SLUG}" == "linux-64" ]]; then
-  log_info 'Disabling strict host key checking for SSH...'
-  echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
-fi
-
 # Setup project variables
 export_env CI_PROJECT_DIR
 export_env CI_PROJECT_NAME
@@ -63,7 +57,8 @@ else
   if [ ! -d ${basedir}/src ]; then
     run_cmd mkdir -p ${basedir}/src
   fi
-  run_cmd git clone --depth 1 ${GITLAB_CHECKOUT_STRATEGY}${CI_PROJECT_PATH} ${CI_PROJECT_DIR}
+  log_info "$ git clone --depth 1 \$\{GITLAB_CHECKOUT_STRATEGY\}/${CI_PROJECT_PATH} ${CI_PROJECT_DIR}"
+  git clone --depth 1 ${GITLAB_CHECKOUT_STRATEGY}${CI_PROJECT_PATH} ${CI_PROJECT_DIR}
 fi
 
 # Gets the latest stable version of a given package or returns the empty string