Net::SSH.start("host", "user", :password => "password") do |ssh| result = ssh.exec!("ls -l") puts result end