Git failed to access the remote code base due to SSH key: Permission denied (publickey). Solution: Generate the key and add it to Git Setting.

1. Generate a key

Terminal input:

Ssh-keygen -t rsa-c" com"Copy the code

2. Add a key

Terminal input:

cat ~/.ssh/id_rsa.pub
Copy the code

Copy the generated content to Github or GitLab into setting-SSH key to create a new key

Git Clone remote code base – success

git clone ... url...Copy the code