Guest User

Untitled

a guest
Jan 22nd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. for h in $SERVER_LIST; do ssh $h "uptime"; done
  2.  
  3. The authenticity of host 'blah.blah.blah (10.10.10.10)' can't be established.
  4. RSA key fingerprint is a4:d9:a4:d9:a4:d9a4:d9:a4:d9a4:d9a4:d9a4:d9a4:d9a4:d9.
  5. Are you sure you want to continue connecting (yes/no)?
  6.  
  7. for h in $SERVER_LIST; do yes | ssh $h "uptime"; done
  8.  
  9. ssh -oStrictHostKeyChecking=no $h uptime
  10.  
  11. Host somehost
  12. Hostname 10.0.0.1
  13. StrictHostKeyChecking no
  14.  
  15. $ ssh -oStrictHostKeyChecking=no somehost uptime
  16. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  17. @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
  18. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  19. IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
  20. Someone could be eavesdropping on you right now (man-in-the-middle attack)!
  21. It is also possible that a host key has just been changed.
  22. The fingerprint for the RSA key sent by the remote host is
  23. 31:6f:2a:d5:76:c3:1e:74:f7:73:2f:96:16:12:e0:d8.
  24. Please contact your system administrator.
  25. Add correct host key in /home/peter/.ssh/known_hosts to get rid of this message.
  26. Offending RSA key in /home/peter/.ssh/known_hosts:24
  27. remove with: ssh-keygen -f "/home/peter/.ssh/known_hosts" -R 10.0.0.1
  28. Password authentication is disabled to avoid man-in-the-middle attacks.
  29. Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
  30. ash: uptime: not found
  31.  
  32. ssh-keyscan -H <ip-address> >> ~/.ssh/known_hosts
  33. ssh-keyscan -H <hostname> >> ~/.ssh/known_hosts
  34.  
  35. ssh-keygen -R <ip-address>
  36. ssh-keygen -R <hostname>
  37.  
  38. for h in $SERVER_LIST; do
  39. ip=$(dig +search +short $h)
  40. ssh-keygen -R $h
  41. ssh-keygen -R $ip
  42. ssh-keyscan -H $ip >> ~/.ssh/known_hosts
  43. ssh-keyscan -H $h >> ~/.ssh/known_hosts
  44. done
  45.  
  46. ssh-keyscan <newhost> >> ~/.ssh/known_hosts
  47.  
  48. # cat LIST_OF_SERVERS
  49. server1
  50. server2
  51. ...
  52. server5
  53. 10.11.0.2
  54. ...
  55. 10.11.0.10
  56.  
  57. # for hh in `cat LIST_OF_SERVERS`; do ssh-keyscan ${hh} >> ~/.ssh/known_hosts ; done
Add Comment
Please, Sign In to add comment