Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

faisalfaiz64's avatar

Gitlab: Permission denied (publickey,keyboard-interactive). fatal: Could not read from remote repository

I'm deploying my laravel project through CI/CD pipeline, when i trigger the deploy branch i got this error

here is my gitlab-ci.yml code

before_script:
  - eval $(ssh-agent -s)
  - echo "$SSH_PRIVATE_KEY" | ssh-add -
  - mkdir -p ~/.ssh
  - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'

.change_file_permissions: &change_file_permissions |
  find . -type f -not -path "./vendor/*" -exec chmod 664 {} \;
  find . -type d -not -path "./vendor/*" -exec chmod 775 {} \;

deploy:
  stage: deploy
  script:
    - *change_file_permissions
    - ssh [email protected] "cd /home/root/public_html/files && git pull "[email protected]:groupname/project/nas-project.git" dev && exit"
  environment:
    name: live
    url: mywebsite.com
  only:
    - dev

0 likes
0 replies

Please or to participate in this conversation.