Я решил эту проблему, следуя пошаговым инструкциям:
Шаг 1: Проверка ключей SSH
$ cd ~/.ssh
# Checks to see if there is a directory named ".ssh" in your user directory
# If it says "No such file or directory" skip to step 3. Otherwise continue to step 2.
Шаг 2: Резервное копирование и удаление существующих ключей SSH
$ ls
# Lists all the subdirectories in the current directory
# config id_rsa id_rsa.pub known_hosts
$ mkdir key_backup
# Makes a subdirectory called "key_backup" in the current directory
$ cp id_rsa* key_backup
# Copies the id_rsa keypair into key_backup
$ rm id_rsa*
# Deletes the id_rsa keypair
Шаг 3 : создание нового ключа SSH
$ ssh-keygen -t rsa -C "your_email@youremail.com"
# Creates a new ssh key using the provided email
# Generating public/private rsa key pair.
# Enter file in which to save the key (/home/you/.ssh/id_rsa):
# Enter passphrase (empty for no passphrase): [Type a passphrase]
# Enter same passphrase again: [Type passphrase again]
# Your identification has been saved in /home/you/.ssh/id_rsa.
# Your public key has been saved in /home/you/.ssh/id_rsa.pub.
# The key fingerprint is:
# 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@youremail.com
Шаг 4 :Добавьте свой SSH-ключ в GitHub
$ sudo apt-get install xclip
# Downloads and installs xclip
$ xclip -sel clip < ~/.ssh/id_rsa.pub
# Copies the contents of the id_rsa.pub file to your clipboard
Затем перейдите в hithub и выполните:
- Перейдите в настройки своей учетной записи
- Нажмите "SSH Keys" влевая боковая панель
- Нажмите «Добавить ключ SSH»
- Вставьте ключ в поле «Ключ»
- Нажмите «Добавить ключ»
- Подтвердите действиевведя свой пароль GitHub
Шаг 5 : Проверьте все
$ ssh -T git@github.com
# Attempts to ssh to github
Если все в порядке, вы увидите
Hi username! You've successfully authenticated, but GitHub does not
# provide shell access.
В противном случае (это случилось со мной), вы увидите
Agent admitted failure to sign using the key.
# debug1: No more authentication methods to try.
# Permission denied (publickey).
Чтобы решить эту проблему
$ ssh-add
# Enter passphrase for /home/you/.ssh/id_rsa: [tippy tap]
# Identity added: /home/you/.ssh/id_rsa (/home/you/.ssh/id_rsa)
Для оригинальной информации
https://help.github.com/articles/generating-ssh-keys
https://help.github.com/articles/error-agent-admitted-failure-to-sign