You can use next command to get the type of the key (RSA, DSA, etc):
# ssh-keygen -l -f .ssh/id_rsa
2048 SHA256:4+Na0ttfBkspSFSYnRjwbwja8/b708lRxzqjPBzLJMw ........ (RSA)
# ssh-keygen -l -f .ssh/id_dsa
1024 SHA256:F6h53Zu0A9M094CbszkwxfQ5L2EZ0kUEpLkH0dp1alU ........ (DSA)
# ssh-keygen -l -f .ssh/id_ed25519
I had the same issue, i was able to ping the but
ssh-keyscan server IP
gave this error:
write(localhost): Connection refused
The issue in my case was ssh port in that server was open on a different port (7999 in my case) rather than the default 22 as ssh port. Explicitly adding the port number solved the issue. Here is the command that worked for me:
I installed OpenSSH server and client
Port 22 is opened
No it's not. At least not to the network path connecting the machines.
Start by pinging the server from the client. If that works (check the IP address) then name resolution, routing and connectivity are OK. Next check the output of sudo netstat -nap | grep :22 | grep LISTEN on the server. ...