• 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
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58

    测试成功

  • 相关阅读:
    基于Spring Boot+vue的酒店管理系统
    谷粒商城-2
    【码银送书第十期】《强化学习:原理与Python实战》
    真题集P123---2011年真题(包括力扣662)
    【Linux】之Jumpserver堡垒机添加Windows主机资产
    react脚手架创建项目,配置别名(alias)
    Docker02:名词解释与安装
    【Java基础】基本数据类型
    security 会话并发管理
    关系型数据库和非关系型数据库
  • 原文地址:https://blog.csdn.net/huangling07031190/article/details/134480161