Permission denied (publickey) trying to SSH into CircleCI job

Viewed 23

I followed the steps of this doc: https://circleci.com/docs/add-ssh-key#circleci-cloud-or-server-3-x

I generated my key:

ssh-keygen -m PEM -t rsa -C "myname@myemail.com"

I copied the content of .ssh/id_ed25519, went to Project Settings > SSH Keys > Additional SHH Keys, and pasted the content of my Key.

However, when I try to ssh I receive the following error:

ssh -p 54782 x.x.x.130

The authenticity of host '[x.x.x.130]:54782 ([x.x.x.x]:54782)' can't be established.

ED25519 key fingerprint is SHA256:xxx

This key is not known by any other names

Are you sure you want to continue connecting (yes/no/[fingerprint])? yes

Warning: Permanently added '[x.x.x.130]:54782' (ED25519) to the list of known hosts.

myname@x.x.x.130: Permission denied (publickey).

I will appreciate your help. Thanks

1 Answers

The instructions you followed are for something else; they are about adding an SSH key to the project in case you need to SSH into remote servers from within a job.

If you want to SSH into your job, you need to add the key you generated on your local machine to your VCS (GitHub or Bitbucket) account.

Related