@soveckii_fonarik
аспирант,начинающий программист - преподаватель

Как заставить работать vs code с github с использование ssh ключа в windows 10?

Добрый день. У меня проблема, которую уже не знаю как побороть
у меня windows 10 1803. Есть стандартный ssh-client и с помощью него сгенерировал ключ
ssh-keygen -t rsa -b 2048
он есть в ~/.ssh/id_rsa и ~/.ssh/id_rsa.pub.

~/.ssh/id_rsa.pub открыл и скопировал на сайт github.com. т.е. он там точно есть.

в cmd пробую
ssh git@github.com
прилетает
Enter passphrase for key 'C:\Users\user/.ssh/id_rsa':

если ввожу пароль, то вроде все норм
Connection to github.com closed.

На github создал репозиторий, скопировал ссылку на него по ssh
git remote -v их отображает.

Так вот, при попытке через vs code запушить изменения на github прилетает
Error: Permission denied (publickey)

spoiler
Please make sure you have the correct access rights
and the repository exists.
> git rev-parse --show-toplevel
fatal: not a git repository (or any of the parent directories): .git
> git rev-parse --show-toplevel
fatal: not a git repository (or any of the parent directories): .git
> git show :server_authentication/app/authentication/init.js
> git check-ignore -z --stdin
> git show :server_authentication/app/user/init.js
> git show :server_authentication/app/authentication/middleware.js
> git fetch
> git show :server_authentication/app/authentication/middleware.js
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.
> git push origin master
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.
> git fetch
> git show :server_authentication/app/authentication/middleware.js
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.



я создал .config файл в ~/.ssh/
spoiler
Host *
ForwardAgent yes

Host git
HostName git@github.com
User user



Но ошибка так и осталась
Поставил github desctop... такая же история
  • Вопрос задан
  • 4168 просмотров
Решения вопроса 1
@soveckii_fonarik Автор вопроса
аспирант,начинающий программист - преподаватель
все оказалось намного проще
просто не указывать пароль при создании ssh ключа :\
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы