0

I am following this, this and this tutorial when trying to setup GitLab with Jenkins on same AWS EC2 machine with self signed certificate. I am stuck at "Source Code Management", everything else went fine. Here is screenshot of error:

enter image description here

I can use Git without problems. From my windows workstation I push/pull code with with both SSH (as git@ec2-....git) or HTTPS (as https://ec2-....git). But when I try to use it from very same Ubuntu 18.04 machine where are Git, Jenkins and GitLab, like this:

Cloning into 'xxxxxxx-xxxxxx-xxxxxxx'...
git@ec2-XX-XX-XX-XX.xxxxxxxxxxxxxxxxx.amazonaws.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ubuntu@ip-XX-XX-XX-XX:~/tmp$

or

ubuntu@XX-XX-XX-XX:~/tmp$ git clone https://ec2-XX-XX-XX-XX.eu-.....e.git
Cloning into 'xxxxxxxxxxxx'...
fatal: unable to access 'https://ec2-XX-XX-XX-XX.eu-.....e.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
ubuntu@XX-XX-XX-XX:~/tmp$

I tried several solutions but none worked. What can I do about this?

Nenad Bulatović
  • 7,238
  • 14
  • 83
  • 113

2 Answers2

0

Try using default account. You need to verify your public key location, if you have kept it under default account or user account location. if you are trying to access through different user apart from default, your public key location has to be as follows:

~/.ssh/authorized_keys
Yash Bindlish
  • 560
  • 5
  • 15
  • Not sure what do you mean by default account? I have two accounts on machine: one is off course 'root' other is obviously 'ubuntu'. Did you refer to them? – Nenad Bulatović Dec 07 '18 at 15:40
  • Ye, it should work with ubuntu if you have copied your public keys into a right path. can you please share your public key path – Yash Bindlish Dec 08 '18 at 05:25
0

If you are using ubuntu user then navigate to path cd /home/ubuntu/.ssh/. -- here you will find the public and private keys if generated. If not generated you can generate them using the ssh-keygen command and copy the public key to the gitlab repo's SSH section.

Also have you copied any keys to the repo in the GitLab repo's SSH section ?

Cheers, Yash

error404
  • 2,684
  • 2
  • 13
  • 21