diff --git a/runner_scripts/root/cleanup.sh b/runner_scripts/root/cleanup.sh
index d7df286c641ab22bfc0fa9d595ed160ad6109559..b8a840b694dfb61ebd7817a94209bd9f9120bd81 100755
--- a/runner_scripts/root/cleanup.sh
+++ b/runner_scripts/root/cleanup.sh
@@ -36,7 +36,7 @@ id -u "$AUTH_USER" >/dev/null 2>&1 || error "User $AUTH_USER does not exist"
 
 ## Use a key pair to authenticate the user (private key has to be set as a GitLab CI/CD variable)
 AUTH_KEY=$CUSTOM_ENV_AUTH_KEY
-AUTH_PUB="/etc/gitlab-runner/auth/${CI_SERVER_HOST}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/authorized_keys"
+AUTH_PUB="/etc/gitlab-runner/auth/${CUSTOM_ENV_CI_SERVER_HOST}/${CUSTOM_ENV_CI_PROJECT_NAMESPACE}/${CUSTOM_ENV_CI_PROJECT_NAME}/authorized_keys"
 
 if [[ ! -f "$AUTH_PUB" ]]; then
     error "Authentication for user $AUTH_USER not configured for this project."
diff --git a/runner_scripts/root/config.sh b/runner_scripts/root/config.sh
index c733da231004dfc5dd558e37c937fc129bbbecb9..3857bc31b0fe4235bcf979f99eedec1c800f79a4 100755
--- a/runner_scripts/root/config.sh
+++ b/runner_scripts/root/config.sh
@@ -17,7 +17,7 @@ function error {
 [ -z "${CUSTOM_ENV_AUTH_USER:+x}" ] && error "AUTH_USER CI/CD variable has not been set."
 [ -z "${CUSTOM_ENV_AUTH_KEY:+x}" ] && error "AUTH_KEY secret CI/CD variable has not been set."
 
-AUTH_PUB="/etc/gitlab-runner/auth/${CI_SERVER_HOST}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/authorized_keys"
+AUTH_PUB="/etc/gitlab-runner/auth/${CUSTOM_ENV_CI_SERVER_HOST}/${CUSTOM_ENV_CI_PROJECT_NAMESPACE}/${CUSTOM_ENV_CI_PROJECT_NAME}/authorized_keys"
 if [[ ! -f "$AUTH_PUB" ]]; then
     error "Authentication for user $AUTH_USER not configured for this project."
 fi
diff --git a/runner_scripts/root/run.sh b/runner_scripts/root/run.sh
index b720e277814d6d1b60979a840a9d9ef5df101d23..d7a14fad9fc4564ce94785845092a4218e4af304 100755
--- a/runner_scripts/root/run.sh
+++ b/runner_scripts/root/run.sh
@@ -41,7 +41,7 @@ id -u "$AUTH_USER" >/dev/null 2>&1 || error "User $AUTH_USER does not exist"
 
 ## Use a key pair to authenticate the user (private key has to be set as a GitLab CI/CD variable)
 AUTH_KEY=$CUSTOM_ENV_AUTH_KEY
-AUTH_PUB="/etc/gitlab-runner/auth/${CI_SERVER_HOST}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/authorized_keys"
+AUTH_PUB="/etc/gitlab-runner/auth/${CUSTOM_ENV_CI_SERVER_HOST}/${CUSTOM_ENV_CI_PROJECT_NAMESPACE}/${CUSTOM_ENV_CI_PROJECT_NAME}/authorized_keys"
 
 if [[ ! -f "$AUTH_PUB" ]]; then
     error "Authentication for user $AUTH_USER not configured for this project."