从Gitlab上拉取代码报错:
Warning: Permanently added 'gitlab.wang.cn,47.94.8.13' (ECDSA) to the list of known hosts. Connection closed by 47.94.148.123 port 22 Could not read from remote repository. Please make sure you have the correct access rights and the repository ...
如图:
意思就是说我要clone的项目的这个gitlab的主机不可知,需要让我配置一下SSH Key。
解决方案:
1、cmd 命令界面录入ssh-keygen -t rsa -C "xx@nandaoxx.com" //重新生成rsa key
其中 xx@nandaoxx.com 可以是一个邮箱,如图:
一直点击enter键,即可生成新的key,如上图所示。
2、去指定目录C:\Users\14344\.ssh 找到 id_rsa.pub 文件,如下图所示。
3、将文件中的 id_rsa.pub 内容全部复制到粘贴到github,个人setting--SSH and GPG keys 添加 个新的key
内容:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDc+cYKfy/Suw1HEt59wKxMjjfkkUCGuB85q9K5i8E5WW2f4PD88QxKYh0n8CgxA/Vyb/srBUJP209zIqR+taQMmerhdgSY0r48+zWkERx35heYA0H9VlTuqQkosFhiPybsZFwRVFO/ITny7bz2f10rjyNn2a5g8jKZkAo9tk8qC8iyDIFN+9AJyprPoLQUBlGBbyMzUrZ0y1nZsJ52KmDo27qtQJqfCLLag+mvHjCgog4B2FgHkqRt3U+2Ul8Yi01UeF/63REguYdJ1a1nEGPljZ0Vsi3BqcvJA8El+tOYyYWwzngky1a8kyXJZLRdG/7xmK2xP7cv667xVA+6te1IcFW+UjpH8I0AtDhKpjNWivPgtTJrXRxintj4Qh4WJ46ieeJmO5v1IJ6TD4+nSirKFAa2sjKmXAgNcApW9v0lmstHCfpDiuBCXFnburyFvjk0ebfKW1kl2oQSkHEDEXsQtGEEqEn5sN/rcOOcP/auzSJbUartPZpOcFSE7+PC/Ts= wanghuainan@xxx.com
点击git:
显示:后把内容粘贴到里面
点击Add key 就成功了,然后再IDEA下载就不报错了。