Display more info when SSH errors occur

240 views
Skip to first unread message

Marc Abramowitz

unread,
Nov 24, 2014, 7:57:25 PM11/24/14
to ansible...@googlegroups.com
I finally got tired of seeing this message:

fatal: [vagrant] => SSH encountered an unknown error during the connection.
We recommend you re-run the command using -vvvv, which will enable SSH debugging 
output to help diagnose the issue
so I went ahead and created a PR to make the error messages more helpful:


Instead of the above error message, you get some more helpful error messages:

fatal: [vagrant] => SSH Error: Host key verification failed.
    while connecting to 127.0.0.1:2222
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help
 diagnose the issue.
fatal: [vagrant] => SSH Error: ssh: connect to host 74.125.239.52 port 22: Operation timed out
    while connecting to 74.125.239.52:22
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help 
diagnose the issue.
fatal: [vagrant] => SSH Error: ssh: connect to host 192.26.5.1 port 22: Network is unreachable
    while connecting to 192.26.5.1:22
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help
diagnose the issue.
fatal: [vagrant] => SSH Error: Permission denied (publickey,password).
    while connecting to 69.163.167.30:22
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help 
diagnose the issue.
fatal: [vagrant] => SSH Error: ssh_exchange_identification: Connection closed by remote host
    while connecting to 74.125.239.52:80
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help 
diagnose the issue.
fatal: [vagrant] => SSH Error: bad permissions: ignore key: 
/Users/marca/.vagrant.d/insecure_private_key
    while connecting to 127.0.0.1:2222
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help 
diagnose the issue.
Let me know if you try it and if you have success or if you have problems. I'll try to update the PR if it needs it.

Marc

Reply all
Reply to author
Forward
0 new messages