kex_exchange_identification: Connection closed by remote host with ~/.ssh/config file

Viewed 844

I have a bastion host where I have configured the ~/.ssh/config file as follows:

Host stage-bastion
        ProxyCommand   ssh -q stage-bastion nc -q0 <capped-ip> 22
        Hostname       <capped-ip>
        User stage
        IdentityFile /home/abc/Documents/key
        Port 1984
        ServerAliveInterval     15
        ServerAliveCountMax     3

And I try to log in as follows:

ssh stage-bastion

and I get the error:

kex_exchange_identification: Connection closed by remote host

I even did a eval "$(ssh-agent -s)" but not luck.

Then I tried normally as below:

ssh -i /home/abc/Documents/key stage@<capped-ip>

Voila it worked and I was able to ssh.

Can someone help me why my ~/.ssh/config is not working and giving the above error?

0 Answers
Related