
处理步骤1. 生成新密钥推荐 ed25519ssh-keygen -t ed25519 -C 你的邮箱xx.com -f ~/.ssh/xxxx_new一路回车即可或设 passphrase。2. 把公钥加到 GitLabpbcopy ~/.ssh/xxxx_new.pub # 或 cat ~/.ssh/xxxx_new.pub打开内网 GitLab →Preferences / 用户设置 → SSH Keys→ 粘贴新公钥 → 设过期时间或按公司规范→ 保存。旧的过期 key 可删掉。3. 让 SSH 用新 key 连内网 Git编辑~/.ssh/config没有就新建Host git.in.xx.com HostName git.in.xx.com User git IdentityFile ~/.ssh/xxxx_new IdentitiesOnly yes4. 验证后再 pullssh -T gitgit.in.xx.com git pull能看到欢迎/权限提示就说明 key 生效了。