You need generate .ssh key and upload public key in you github account.
example you problem: in my user has not keys in .ssh
root@surgai:~# ls -lah .ssh/ drwx------ 2 root root 4,0K ноя 13 09:24 . drwx------ 8 root root 4,0K ноя 13 09:24 .. -rw-r--r-- 1 root root 142 ноя 13 09:24 known_hosts
Check login: root@surgai:~# ssh -T [email protected] [email protected]: Permission denied (publickey).
Check clone: root@surgai:~# git clone [email protected]:kortina/dotfiles.git Cloning into «dotfiles»... [email protected]: Permission denied (publickey). fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
Fix: make key: root@surgai:~# ssh-keygen -t ed25519 Generating public/private ed25519 key pair. Enter file in which to save the key (/root/.ssh/id_ed25519): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_ed25519 Your public key has been saved in /root/.ssh/id_ed25519.pub
Now upload /root/.ssh/id_ed25519.pub in you githib account - https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
And check:
root@surgai:~# ssh -T [email protected] Hi surgai! You've successfully authenticated, but GitHub does not provide shell access.
Clonning now success:
root@surgai:~# git clone [email protected]:kortina/dotfiles.git Cloning into «dotfiles»... remote: Enumerating objects: 5072, done. remote: Counting objects: 100% (1761/1761), done. remote: Compressing objects: 100% (577/577), done. remote: Total 5072 (delta 1133), reused 1687 (delta 1078), pack-reused 3311 (from 1)