3

I just configure two ssh keys on git, but when i test ssh connection it returns a error,here is the

debug log:

debug1: key_load_public: No such file or directory

Connection to code.aliyun.com closed by remote host.
Connection to code.aliyun.com closed.
Transferred: sent 2528, received 1472 bytes, in 0.0 seconds
Bytes per second: sent 12863830.2, received 7490331.5
debug1: Exit status -1

I don't know where went wrong, I have send the public key to the sever and still got a error,thanks

Venki WAR
  • 1,997
  • 4
  • 25
  • 38
Tyro F
  • 33
  • 1
  • 5
  • Possible duplicate of [Multiple GitHub Accounts & SSH Config](https://stackoverflow.com/questions/3225862/multiple-github-accounts-ssh-config) – phd Jul 31 '18 at 12:26

1 Answers1

1

It depends on the exacy SSH URL you are using once you have configured those two keys.

Configuring multiple SSH keys should be done in a ~/.ssh/config file

Host key1
 HostName code.aliyun.com
 IdentityFile ~/.ssh/my_key1
 User git
Host key2
 HostName code.aliyun.com
 IdentityFile ~/.ssh/my_key2
 User git

The URL would then be:

key1:aUSer/aRepo
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250