PTY Multiple logins (readpartial blocks)

Hi everyone,

at the moment I’m working with ruby and pty to automate multiple logins
on some linux (RH7) servers. Certainly the logins stop between the 6th
and 10th login. Everytime I’m using readpartial or readline, the
loginprocess stops, like there is no data in the stdout. My ruby code is
similar to the one below:

15.times do |i|
puts “#{i + 1}. login:”
sleep 1
stdout, stdin, pid = PTY.spawn(“ssh -o NumberOfPasswordPrompts=1
[email protected]”)
sleep 1
puts stdout.readpartial(4096)
Process.kill(9, pid)

Could it be, that stdout has a limit of data storage or that i have to
invoke a command to flush stdout?