git问题: git@10.18.*.*: Permission denied (publickey,password)

遇到的问题:
在这里插入图片描述

openSSH版本太高,openssh高版本默认禁止ssh-rsa加密算法,直接换ed25519

执行以下命令:
在.ssh目录下执行:ssh-keygen -t ed25519 -C “youremail.com”
ssh-add ~/.ssh/id_ed25519
将id_ed25519.pub添加到后台网页ssh key中
eval `ssh-agent -s`
修改config文件:
在这里插入图片描述

测试:
ssh -vT git@10.18..

darling@h1111 MINGW64 ~/.ssh
$
debug1: load_hostkeys: fopen /c/Users/yourdir/.ssh/known_hosts: No such file or directory
debug1: load_hostkeys: fopen /c/Users/yourdir/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: checking without port identifier
debug1: load_hostkeys: fopen /c/Users/yourdir/.ssh/known_hosts: No such file or directory
debug1: load_hostkeys: fopen /c/Users/yourdir/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: hostkeys_find_by_key_hostfile: hostkeys file /c/Users/yourdir/.ssh/known_hosts does not exist
debug1: hostkeys_find_by_key_hostfile: hostkeys file /c/Users/yourdir/.ssh/known_hosts2 does not exist
debug1: hostkeys_find_by_key_hostfile: hostkeys file /etc/ssh/ssh_known_hosts does not exist
debug1: hostkeys_find_by_key_hostfile: hostkeys file /etc/ssh/ssh_known_hosts2 does not exist
The authenticity of host '[10.18.*.*]:41155 ([10.18.*.*]:41155)' can't be established.
ED25519 key fingerprint is SHA256:YQTF1GhPP+gABu9xpqa+5u9dOCqr9cBySU7Ng+mBsic.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[10.18.*.*]:41155' (ED25519) to the list of known hosts.
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: get_agent_identities: bound agent to hostkey
debug1: get_agent_identities: ssh_fetch_identitylist: agent contains no identities
debug1: Will attempt key: /c/Users/yourdir/.ssh/id_ed25519 ED25519 SHA256:ZL5zqdaIG4n9BR8y1PVQsw7pWDj6IS/3k9U3gPqL6iI explicit
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /c/Users/yourdir/.ssh/id_ed25519 ED25519 SHA256:ZL5zqdaIG4n9BR8y1PVQsw7pWDj6IS/3k9U3gPqL6iI explicit
debug1: Server accepts key: /c/Users/yourdir/.ssh/id_ed25519 ED25519 SHA256:ZL5zqdaIG4n9BR8y1PVQsw7pWDj6IS/3k9U3gPqL6iI explicit
Authenticated to 10.18.*.* ([10.18.*.*]:41155) using "publickey".
debug1: channel 0: new session [client-session] (inactive timeout: 0)
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: filesystem
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
PTY allocation request failed on channel 0
Welcome to GitLab, @darling!
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to 10.18.*.* closed.
Transferred: sent 2456, received 2708 bytes, in 0.6 seconds
Bytes per second: sent 4442.7, received 4898.6
debug1: Exit status 0

测试成功

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值