Guest User

Untitled

a guest
Jan 6th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. require 'rubygems'
  2. require 'net/ssh'
  3.  
  4.  
  5. begin
  6. Net::SSH.start("1.2.3.4", "root", :password=>"secret") do |ssh|
  7. puts "connected"
  8. end
  9.  
  10. rescue
  11. puts "something wrong"
  12. end
  13.  
  14. # manual ssh to host returns "Connection closed by 1.2.3.4"
  15. # net-ssh doesn't raise exception, continues attempting connection
Add Comment
Please, Sign In to add comment