• 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

    测试成功

  • 相关阅读:
    Web3名词解释
    鸿蒙HarmonyOS实战-ArkUI组件(Menu)
    如何利用客户旅程打造好的用户体验?
    react18+Ts+V6最新实战项目来袭!
    OpenCV必知必会基础3(包括色彩空间的变换、ROI、OpenCV中最重要的结构体Mat以及获取图像的属性)
    EtherCAT 伺服控制功能块实现
    L46.linux命令每日一练 -- 第七章 Linux用户管理及用户信息查询命令 -- w和who
    什么是响应式设计?响应式设计的基本原理是什么?如何兼容低版本的 IE?
    LeetCode每日一题:2731. 移动机器人(2023.10.11 C++)
    弃用 ifconfig 吧,你值得收藏的 IpRoute2 简明指南
  • 原文地址:https://blog.csdn.net/huangling07031190/article/details/134480161