git@e.coding.net: Permission denied (publickey).

发布时间 2023-11-16 16:25:22作者: 炎黄子孙,龙的传人

git@e.coding.net: Permission denied (publickey).

步骤一:打开 ~/.ssh/config 文件

步骤二:添加域名对应的 ssh_key 私钥

# bitbucket.org
Host bitbucket.org
  AddKeysToAgent yes
  IdentityFile ~/.ssh/bitbuket_ssh

# coding.net   
Host e.coding.net
  HostName e.coding.net
  PreferredAuthentications publickey
  PubkeyAcceptedKeyTypes +ssh-rsa
  IdentityFile ~/.ssh/coding_net

测试结果:

ssh -T git@e.coding.net

返回:

# CODING 提示: Hello **xxx**, You've connected to coding.net via SSH. This is a Personal Key.
# **xxx**,你好,你已经通过 SSH 协议认证 coding.net 服务,这是一个个人公钥.
# 公钥指纹:f8:55:43:bb:a5:53:6b:5d:04:1d:7c:19:4b:2f:00:ff

ref: