一位用户遭遇GitHub SSH密钥认证突然失败的问题,系统返回"Permission denied (publickey)"错误信息 [1]。经过排查,用户发现根本原因在于私钥文件缺少对应的.pub公钥文件 [1]。
用户通过执行命令 ssh-keygen -y -f ~/.ssh/github_rsa > ~/.ssh/github_rsa.pub 生成了.pub文件后,认证问题得以解决 [1]。为验证这个修复方案,用户进行了对照测试:在没有.pub文件的情况下连续12次全部被拒,而添加.pub文件后连续12次全部接受 [1]。
用户推测,GitHub服务器软件可能近期进行了更新 [1]。根据观察,GitHub SSH服务器标识从"babeld-"变更为"6a2c000" [1]。用户分析认为,GitHub现已拒绝直接签名的publickey认证请求,而只接受包含探测-签名认证流程的方式 [1]。这两种流程虽均符合RFC 4252规范 [1],但GitHub的政策调整使得仅有私钥而缺少公钥文件的用户面临认证障碍。
A user encountered an unexpected authentication failure when attempting to connect to GitHub via SSH, receiving a "Permission denied (publickey)" error [1]. After investigation, the root cause was identified: the absence of a corresponding .pub public key file alongside the private key [1].
The user resolved the issue by generating the missing public key file using the command ssh-keygen -y -f ~/.ssh/github_rsa > ~/.ssh/github_rsa.pub [1]. To validate this fix, the user conducted twelve comparative tests and confirmed that all twelve connection attempts without the .pub file were rejected, while all twelve attempts with the file present were accepted [1].
The underlying cause appears to be a change in GitHub's SSH server infrastructure. The server identifier shifted from "babeld-" to "6a2c000," suggesting a software update [1]. The user theorizes that GitHub's servers now reject direct signing authentication requests and only accept probe-then-sign authentication workflows [1]. While RFC 4252 permits both authentication methods—direct signing and probe-then-sign—GitHub has apparently restricted its acceptance to the latter approach [1].