5

I'm trying to set up a simple gitlab CI for an angular project

I just made a runner on staging server.

Here is an extract of config.toml in /etc/gitlab-runner

  name = "awsTest10"
  url = "http://gitlab.XXXXXXX/ci"
  token = "XXXXXXXXXXXXXXXXXXXXX"
  executor = "ssh"
  [runners.ssh]
    user = "root"
    host = "ec2-XX-XX-XX-XX.eu-west-1.compute.amazonaws.com"
    port = "22"
    identity_file = "/root/.ssh/id_rsa"
  [runners.cache]

I created a ssh key with root and I copied the public part in gitlab deploys keys. I made ssh-add before.

When I use the runner I have the following result :

Running with gitlab-ci-multi-runner 1.11.1 (a67a225)
  on awsTest10 (e1ce142d)
Using SSH executor...
ERROR: Preparation failed: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
Will be retried in 3s ...
Using SSH executor...
ERROR: Preparation failed: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
Will be retried in 3s ...
Using SSH executor...
ERROR: Preparation failed: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
Will be retried in 3s ...
ERROR: Job failed (system failure): ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

Thanks for help

chd
  • 141
  • 3
  • 9

1 Answers1

5

I had the same problem. I appended public key to ~/.ssh/authorized_keys and uncomment AuthorizedKeysFile %h/.ssh/authorized_keys line in the /etc/ssh/sshd_config file. Then i restarted ssh service and it works for me.

Yurii Sherbak
  • 126
  • 1
  • 5