Skip to content

Instantly share code, notes, and snippets.

View windwiny's full-sized avatar

windwiny windwiny

View GitHub Profile
@KINGSABRI
KINGSABRI / ex-ssh-pty.rb
Created August 28, 2012 16:04
ex. SSH with real PTY
require 'net/ssh'
host = "the.host"
user = "joe"
su_user = "bob"
password = "password"
commands = ["cd /", "pwd", "ls -l", "exit"]
finished = ("%08x" * 8) % Array.new(8) { rand(0xFFFFFFFF) }