Permission denied (publickey) Gitlab

Hallo sobat developer, siapa sih yang tidak kenal gitlab dikalangan developer ? Pernah kalian mengalami kejadian dengan pesan dibawah ini ketika kalian hendak push projek kalian ke gitlab ?

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Jika kalian pernah melakukan ini, yuk kita buat agar permasalahan ini selesai.

Pertama kalian generate key baru di lokal notebook kalian dengan cara :

ssh-keygen -t rsa -C “gitlab” -b 4096

dan nanti akan berakhir seperti dibawah ini :

Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:tmR8oqqTjFdKrQVVb0MV18vvEsk85D2nhDh/9pP9gTc gitlab
The key’s randomart image is:
+—[RSA 4096]—-+
| .. ..o… |
| . o . . |
| . + . . |
| . o . + |
| o S .. * + |
| . + = +o . X.+|
| + * . . o o E=|
|. B . . *o=|
| ..o. o o=|
+—-[SHA256]—–+

Jika sudah seperti ini, kalian cari file dengan nama id_rsa.pub terletak didalam folder .ssh (biasanya folder hidden).

Setelah itu buka file tersebut didalam notepad, lalu copied.! Setelah di copy, sekarang kalian lakukan :

  • Login akun gitlab
  • Masuk ke menu setting
  • Masuk ke menu ssh key
  • Pastekan didalam kolom key, lalu kalian beri nama dikolom title
  • Klik Addkey

Sekarang kalian coba push projek kalian dan semoga berhasil

Author: Hafid

Hi! My name is Hafid and I'm Indonesian DKI Jakarta. Here's my profile www.mhafid.com. In here, I share a lot of information about programming and linux there.

Leave a Reply

Your email address will not be published. Required fields are marked *