Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. require 'net/ssh'
  2. require 'logger'
  3.  
  4. ssh_options = {}
  5. ssh_options[:auth_methods] = ["publickey"]
  6. ssh_options[:verbose] = :debug
  7.  
  8. Net::SSH.start(
  9. 'login.example.com', 'rick', ssh_options
  10. ) do |session|
  11. output = ssh.exec!("hostname")
  12. puts output
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement