git连接github和gitlab的疑问

    技术2026-02-04  5

    按照https://www.jianshu.com/p/68578d52470c配置后进行连接操作时 github可以正常使用@host名称连接 gitlab只能通过@gitlab连接

    $ ssh -T git@github.com The authenticity of host 'github.com (140.82.114.3)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'github.com,140.82.114.3' (RSA) to the list of known hosts. Hi lahhass! You've successfully authenticated, but GitHub does not provide shell access. $ ssh -T git@gitlab.com The authenticity of host 'gitlab.com (xxx.xx.xxx.xx)' can't be established. ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'gitlab.com,xxx.xx.xxx.xx' (ECDSA) to the list of known hosts. git@gitlab.com: Permission denied (publickey). $ ssh -T git@gitlab Welcome to GitLab, @x!
    Processed: 0.025, SQL: 9