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 ...
随机推荐
- Centos75下samba搭建配置
工作中,很经常需要把Linux服务器上的文件共享到windows上面,这时候需要在Linux服务器上安装samba套件. samba服务很好的实现了windows和linux之间的文件共享. 下面配置 ...
- P1174 打砖块
P1174 打砖块 普通分组背包:50pts 题解说的啥????(大雾) 看了半天 $s[0/1][i][j]$表示第$i$列用$j$发子弹,最后一发是1/否0打在该列上的价值 $f[0/1][i][ ...
- android驱动学习---led实验
======================== 驱动: 内核:android-kernel 2.6.36 (必须对应你的板子上内核,不然会出现insmod错误) 目的:通过android应用层用户 ...
- 学习Zookeeper之第3章Zookeeper内部原理
第 3 章 Zookeeper 内部原理 3.1 选举机制 3.2 节点类型 3.3 stat 结构体 3.4 监听器原理 1)监听原理详解 2)常见的监听 3.5 写数据流程 第 3 章 Z ...
- java maven 操作 收集的一些命令
maven打包: mvn clean package -Dmaven.test.skip=true 运行jar: java -jar target/spring-boot-scheduler-1.0. ...
- OpenDayLight Helium安装
参照:OpenDaylight的Helium(氦)版本安装 下载链接地址为 http://www.opendaylight.org/software/downloads/helium 安装: unzi ...
- 将日期转换为指定的格式:比如转换成 年月日时分秒 这种格式:yyyy-MM-dd hh:mm:ss 或者 yyyy-MM-dd。总结下。
可以为Date原型添加如下的方法: Date.prototype.format = function(fmt) { var o = { "M+" : this.getMonth() ...
- springboot logback + log4j2日志管理
springboot的web项目中自带了日志组件: 我们看一下,springboot中找到日志组件. <dependency> <groupId>org.springframe ...
- c++ 字符串拷贝以及合并
#include<iostream> #include<string> using namespace std; class stringfun { ]; public: vo ...
- Mac系统下adb工具的配置
sudo vim ~/.bash_profile 增加如下内容 ANDROID_HOME=/Users/apple/Library/Android/sdk export PATH=$PATH:$AND ...