Error : Clone the Midnight-node-docker Repository

cd midnight-node-docker
Cloning into ‘midnight-node-docker’…
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
-bash: cd: midnight-node-docker: No such file or directory

2 Likes

hey @R_Kash this error occurs when Git attempts to clone a repository using SSH, but your machine does not have a valid public key configured or does not have permission to access that repository.

Follow these steps to fix it:

i) Check if you already have an SSH key:

In your terminal run:

ls ~/.ssh

If you have it you will see a .pub file similar to this:

id_rsa.pub 

If you don’t see a file or get an error, generate a new key:

ssh-keygen -t rsa -b 4096 -C "your-github-email@example.com" 

Press Enter to accept the default file location.

ii) Add your SSH key to the SSH agent:

Start the agent:

eval "$(ssh-agent -s)" 

Add your key:

ssh-add ~/.ssh/id_rsa 

iii) Add your SSH public key to GitHub:

Copy your public key to the clipboard:

cat ~/.ssh/id_rsa.pub 

Go to GitHub’s SSH keys page:
https://github.com/settings/keys

Click “New SSH key”, paste the key into the field, give it a descriptive title (e.g., “My Laptop”), and save.


iv) Test your SSH connection to GitHub:

ssh -T git@github.com 

You should see a message like:

Hi <your_username>! You've successfully authenticated. 

After this is done

Now you can clone the repo via SSH:

git clone git@github.com:midnight-ntwrk/midnight-node-docker.git

then

cd midnight-node-docker 

Tell me if that works!

1 Like

Thanks, But I already downloaded the zip to my local PC, and copied it to my server.
Now I understand why it was getting the error.

1 Like

why was it your mistake? If it was for your server you could have done it with an expiration auth token too!

1 Like