git连接报错:Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)
在Linux上已经安装过git(自己搭建)了,本机(windows)想连接过去,通过git bash敲了下clone命令提示没权限:
$ git clone git@111.11.111.11:code.git
Cloning into 'code'...
The authenticity of host '111.11.111.11 (111.11.111.11)' can't be established.
ECDSA key fingerprint is SHA256:7jmL7Nrr9zJ7psJd3Zcfr4UckRNOMkgwK/ae9dsCgaw.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '111.11.111.11' (ECDSA) to the list of known hosts.
git@111.11.111.11's password:
Connection closed by 111.11.111.11 port
fatal: Could not read from remote repository. Please make sure you have the correct access rights
and the repository exists.
第一次连接失败很正常,毕竟没有设置账号信息,但第二次连接敲了自己刚设置的密码,竟然一直提示没权限
$ git clone git@111.11.111.11:code.git
Cloning into 'code'...
git@111.11.111.11's password:
Permission denied, please try again.
git@111.11.111.11's password:
Permission denied, please try again.
git@111.11.111.11's password:
git@111.11.111.11: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,pas sword).
fatal: Could not read from remote repository. Please make sure you have the correct access rights
and the repository exists.
蒙圈了,密码对的啊。看下日志:
$ ssh -vT git@111.11.111.11
OpenSSH_7.6p1, OpenSSL 1.0.2n Dec
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to 111.11.111.11 [111.11.111.11] port .
debug1: Connection established.
debug1: identity file /c/Users/wulf/.ssh/id_rsa type
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/wulf/.ssh/id_rsa-cert type -
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/wulf/.ssh/id_dsa type -
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/wulf/.ssh/id_dsa-cert type -
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/wulf/.ssh/id_ecdsa type -
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/wulf/.ssh/id_ecdsa-cert type -
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/wulf/.ssh/id_ed25519 type -
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/wulf/.ssh/id_ed25519-cert type -
debug1: Local version string SSH-2.0-OpenSSH_7.
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.
debug1: match: OpenSSH_7. pat OpenSSH* compat 0x04000000
debug1: Authenticating to 111.11.111.11: as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: aes128-ctr MAC: umac--etm@openssh.com comp ression: none
debug1: kex: client->server cipher: aes128-ctr MAC: umac--etm@openssh.com comp ression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:7jmL7Nrr9zJ7oooo5Zcfr4UckRNO MkgwK/ae9dsCgaw
debug1: Host '111.11.111.11' is known and matches the ECDSA host key.
debug1: Found key in /c/Users/wulf/.ssh/known_hosts:
debug1: rekey after blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-,rsa-sha2->
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mi c,password
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:gXnx5odooo7yK+Imse/ggjIzZdooooJwCU6T6PEy spk /c/Users/wulf/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mi c,password
debug1: Trying private key: /c/Users/wulf/.ssh/id_dsa
debug1: Trying private key: /c/Users/wulf/.ssh/id_ecdsa
debug1: Trying private key: /c/Users/wulf/.ssh/id_ed25519
debug1: Next authentication method: password
然后又死循环了,让我输入密码。看日志里这个c/Users/wulf/.ssh目录下有啥东西,就发现原来这里有我的公钥:
$ cat /c/Users/wulf/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCf20s0rabgMRn8CCCCC/+VC/wS5x/dvIYoG+TP23bHWn9gD/AXizrkds5geX9AG90oVRqf+RfTvLFlaNMrzK
公钥太长,上面就只是随便贴了点。后来才发现linux上的服务端git根本不认识你,因为你有的是你自己的密码,人家那还没有你的公钥呢,得去它那里设置一下。
登陆linux下的111.11.111.11,把上面那段公钥贴到服务端authorized_keys里:
vi /home/git/.ssh/authorized_keys
贴好后保存后再去windows的git bash本地连下,这次ok了:
$ git clone git@111.11.111.11:code.git
Cloning into 'code'...
warning: You appear to have cloned an empty repository.
git连接报错:Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)的更多相关文章
- Visual Studio Code 使用 Git插件报错 - Permission denied (publickey)
在使用GitHub的时候,为了避免每次输入用户名密码,都会使用SSH方式代替Https. 按网上教程,大多数使用SSH-KeyGen生成公私钥对,而后上传公钥至Github,并切换Repositori ...
- Mac ssh 连接报错 Permission denied (publickey)
用的阿里云服务器,如果直接连接,会报下面错误: $ ssh root@47.94.132.115 Permission denied (publickey). 创建服务器的时候,连接秘钥会生成并下载到 ...
- IDEA中使用git报错Permission denied (publickey)
最近在使用idea开发时,使用git拉取远程仓库的代码时,报错Permission denied (publickey),原因是因为ssh的密钥失效,必须得重新设置下ssh的密钥即可. 命令很简单,在 ...
- 解决方案 git@github.com出现Permission denied (publickey)
ubentu 13.10 git version 1.8.3.2 解决方案:ssh -T git@github.com出现Permission denied (publickey).的问题 今天的任 ...
- 【转载】解决方案:git@github.com出现Permission denied (publickey)
遇到的问题 今天心血来潮,想将intellij上的项目代码放到GitHub上管理. 在进行添加远程库的时候,出现了:git@github.com出现Permission denied (publick ...
- Git push提交时报错Permission denied(publickey)...Please make sure you have the correct access rights and the repository exists.
一.git push origin master 时出错 错误信息为: Permission denied(publickey). fatal: Could not read from remote ...
- jenkins报错Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password) 的处理
问题背景:jenkins服务器发布代码后需要执行删除缓存的操作ssh -p222 eus_pe_devadmin@1.1.1.1 "sudo rm -rf /dev/shm/nginx/hi ...
- git push是报Permission denied (publickey)错误解决
今天晕了半天了,搞了个git工程到github上,以为很简单,因为之前也弄过,那知道搞了大半天都搞不好,一直报如下错误 D:\javawork\ee-0.0.1-SNAPSHOT>git pus ...
- git@github.com出现Permission denied (publickey)
上传项目的时候出现Permission denied (publickey)这个问题 解决方案如下: 看本地的.git/config设置的仓库url地址和github使用的链接地址是否一致如下图,如u ...
- ssh 密码连接报错 permission denied
背景:ssh连接openstack king时,出错permission denied (publickey,gssapi-keyex,gssapi-with-mic) 原因:king未开启ssh ...
随机推荐
- 一个Golang例子:for + goroutine + channel
Rob Pike 在 Google I/O 2012 - Go Concurrency Patterns 里演示了一个例子(daisy chain). 视频地址:https://www.youtube ...
- vs显示行号
1.工具 2.选项 3.文本编辑器 4.C\C++ 5.常规->显示行号
- Vim 的光标移动定位
一.光标移动以单个字符为单位: 在命令模式中 h向左 l 向右 j 向上 k 向下 二.光标移动以word 为单位: w 将光标向前移动一个word; b 将光标向后移动一个word: 以上2个命令光 ...
- 这些HTML、CSS知识点,面试和平时开发都需要 No1-No4(知识点:HTML、CSS、盒子模型、内容布局)
这些HTML.CSS知识点,面试和平时开发都需要 No1-No4 系列知识点汇总 这些HTML.CSS知识点,面试和平时开发都需要 No1-No4(知识点:HTML.CSS.盒子模型.内容布局) ...
- linux shell执行原理
shell简介 Shell是系统的用户界面,提供了用户与内核进行交互操作的一种接口.它接收用户输入的命令并把它送入内核去执行. 运行背景 a 一个基本的linux系统结构 b.由上图可以看出,shel ...
- Linux命令详解-type
type命令用来显示指定命令的类型. 一个命令的类型可以是如下之一 alias 别名 keyword 关键字,Shell保留字 function 函数,Shell函数 ...
- oracle表的统计信息完全正确,执行计划无故改变。原厂人员如是回复
就像在电话里提到的那样,Oracle内部的优化器是根据一系列的内部算法基于表上的统计信息来产生执行计划的.对于特别复杂的SQL语句,Oracle的优化器有一定几率不能得到最优的执行计划(因为机器代码实 ...
- 识别User Agent屏蔽一些Web爬虫防采集
识别User Agent屏蔽一些Web爬虫防采集 from:https://jamesqi.com/%E5%8D%9A%E5%AE%A2/%E8%AF%86%E5%88%ABUser_Agent%E5 ...
- Jacoco的原理
覆盖率计数器 Jacoco使用一系列的不同的计数器来做覆盖率的度量计算.所有这些计数器都是从java的class文件中获取信息,这些class文件可以(可选)包含调试的信息在里面.即使在没有源码的情况 ...
- 关于面向对象和String类型的 09,10
package test.面试题; public class Test9 { public static void main(String[] args){ Outer.Inner in=new Ou ...