diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8ae5c87e6ad3374af7debd78f0da60d079069fbd..3d3f31f762f44408e11fa96a392e3f72839aa461 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,12 +3,29 @@
 image: python:latest
 
 stages:
+  - pretest
   - build
   - test
   - coverage
   - doc_build
   - deploy
 
+ssh:
+  stage: pretest:
+  before_script:
+  - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
+  - 'which rsync || apt-get install rsync -y'
+  - eval $(ssh-agent -s)
+  - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
+  - mkdir -p ~/.ssh
+  - chmod 700 ~/.ssh
+  - echo "$SSH_PRIVATE_KEY" > ~/.ssh/gitlab_rsa
+  - echo "$SSH_PUBLIC_KEY" > ~/.ssh/gitlab_rsa.pub
+  
+    
+  script:
+  - ssh -p50022 bolirev@bioneuro77.biologie.uni-bielefeld.de "mkdir -p /fastdata/html/navipy/"
+
 navipy_install:
   stage: build
   before_script:
@@ -82,10 +99,13 @@ pages:
   before_script:
   - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
   - 'which rsync || apt-get install rsync -y'
-  - mkdir -p ~/.ssh
   - eval $(ssh-agent -s)
-  - '[[ -f /.dockerenv ]] && echo -e "Host *ntStrictHostKeyChecking nonn" > ~/.ssh/config'
-  - ssh-add <(echo "$PRIVATE_KEY")
+  - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
+  - mkdir -p ~/.ssh
+  - chmod 700 ~/.ssh
+  - echo "$SSH_PRIVATE_KEY" > ~/.ssh/gitlab_rsa
+  - echo "$SSH_PUBLIC_KEY" > ~/.ssh/gitlab_rsa.pub
+  
     
   script:
   - ssh -p50022 bolirev@bioneuro77.biologie.uni-bielefeld.de "mkdir -p /fastdata/html/navipy/"