I generated SSHKeys by command line in Mac
- ssh-keygen
- also start Agent and add key
- sh-add -K ~/.ssh/id_rsa
- ssh-add -l
The .ssh/config is:
Host *
IdentityFile ~/.ssh/id_rsa
AddKeysToAgent yes
UseKeychain yes
PubkeyAcceptedKeyTypes +rsa-sha2-256,rsa-sha2-512
Also add SSHpublic keys in Manage account->SSH Keys
But when doing "ssh -Tvvv git@bitbucket.org"
I got "git@bitbucket.org: Permission denied (publickey)." error, can't access server.
I also tried ed25519 format key, the same error.
Does anyone can help? Thanks.
The log is:
yajia-58ae7:.ssh yajia$ ssh -Tvvv git@bitbucket.org
OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/yajia/.ssh/config
debug1: /Users/yajia/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: Connecting to bitbucket.org port 22.
debug1: Connection established.
debug1: identity file /Users/yajia/.ssh/id_rsa type 0
debug1: identity file /Users/yajia/.ssh/id_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
debug1: Remote protocol version 2.0, remote software version conker_7e57468e48 40657e7a095a
debug1: no match: conker_7e57468e48 40657e7a095a
debug3: fd 5 is O_NONBLOCK
debug1: Authenticating to bitbucket.org:22 as 'git'
debug3: hostkeys_foreach: reading file "/Users/yajia/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /Users/yajia/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys from bitbucket.org
debug2: languages ctos:
debug2: languages stoc: ......
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/yajia/.ssh/id_rsa RSA SHA256:KK0EMREf46l44LtCOW+vL0+nJC0IEqTJzWej3fjMFsY explicit agent
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
git@bitbucket.org: Permission denied (publickey).