SSH login server error:
Ncat: Proxy connection failed: Connection refused.
kex_exchange_identification: Connection closed by remote host
The generated public key has been placed on the server, use the private key to connect to the server, and log in to the server
ssh -i /Users/家目录/.ssh/id_rsa [email protected] -p 22
Execute the command and report the following error:
Ncat: Proxy connection failed: Connection refused.
kex_exchange_identification: Connection closed by remote host
Checking the private key permissions, it is found that the id_rsa file permissions are incorrect and an error is reported. According to the ssh protocol guidelines, only users who have the private key have read and write permissions. Users in the same group and other users should not have any permissions, so you need to modify the id_rsa permissions:
ls -l
-rw-r--r--@ 1 bigdata Users 1674 3 4 14:42 id_rsa
Modify permissions
chmod 600 id_rsa
Check permissions again
ls -l
-rw-------@ 1 bigdata Users 1674 3 4 14:42 id_rsa
After modifying the permissions, you can successfully log in to the server