首页 > Windows开发 > 详细

报错:git@192.168.48.48: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)

时间:2021-05-24 15:16:58      阅读:350      评论:0      收藏:0      [点我收藏+]

通过git clone完项目然后进行npm install 报错

1 npm ERR! git@192.168.48.48: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
2 npm ERR! fatal: Could not read from remote repository.
3 npm ERR!
4 npm ERR! Please make sure you have the correct access rights
5 npm ERR! and the repository exists.

原因:缺少SSH密钥

解决方法:

  • 打开项目里面.git文件夹(为隐藏文件夹)
  • 打开config文件,将项目的SSH地址复制到相应位置
  • 技术分享图片
  • 设置git的user name和email
  • 1 $ git config --global user.name "test" 
    2 $ git config --global user.email "test@gmail.com"

     

  • 打开git bash here,输入
    1 ssh-keygen -t rsa -C “test@gmail.com”

    然后一直点回车

  • 在远程仓库上添加ssh密钥,添加的是“id_rsa.pub”(在用户文件下的.ssh文件夹内)里面的公钥

 

报错:git@192.168.48.48: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)

原文:https://www.cnblogs.com/coder-zero/p/14804021.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!