Ответ 1
Устранена проблема... вам нужно добавить открытый ключ ssh в свою учетную запись github.
- Убедитесь, что ssh-ключи настроены правильно.
- Выполнить
ssh-keygen
- Введите пароль (сохраните путь по умолчанию -
~/.ssh/id_rsa
)
- Выполнить
- Добавить открытый ключ (
~/.ssh/id_rsa.pub
) в аккаунт github - Попробуйте
git clone
. Он работает!
Исходное состояние (открытый ключ не добавлен в учетную запись h2 >
[email protected]:~$ rm -rf test [email protected]:~$ ls [email protected]:~$ git clone [email protected]:devendra-d-chavan/test.git Cloning into 'test'... Permission denied (publickey). fatal: The remote end hung up unexpectedly [email protected]:~$
Теперь добавьте открытый ключ ~/.ssh/id_rsa.pub
в учетную запись github (я использовал cat ~/.ssh/id_rsa.pub
)
[email protected]:~$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/foo/.ssh/id_rsa): Created directory '/home/foo/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/foo/.ssh/id_rsa. Your public key has been saved in /home/foo/.ssh/id_rsa.pub. The key fingerprint is: xxxxx The key randomart image is: +--[ RSA 2048]----+ xxxxx +-----------------+ [email protected]:~$ cat ./.ssh/id_rsa.pub xxxxx [email protected]:~$ git clone [email protected]:devendra-d-chavan/test.git Cloning into 'test'... The authenticity of host 'github.com (207.97.227.239)' can't be established. RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts. Enter passphrase for key '/home/foo/.ssh/id_rsa': warning: You appear to have cloned an empty repository. [email protected]:~$ ls test [email protected]:~/test$ git status # On branch master # # Initial commit # nothing to commit (create/copy files and use "git add" to track)