Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GIt connection closed by remote host

Tags:

git

ssh

rsa

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

like image 319
Tyro F Avatar asked Apr 27 '26 13:04

Tyro F


1 Answers

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
like image 200
VonC Avatar answered Apr 30 '26 03:04

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!