From: "Rudá G." Date: 2013-05-08T23:32:30+09:00 Subject: Connect to a switch with SSH I need connect to a Cisco Switch with SSH and Ruby. The main problem is the authentication which is different. I must enter 'login as', 'User Name' and 'Password'. The 'login as' can be any value, usually I just press enter (empty value). My first try was with Net::SSH but it was impossible to authenticate. I don't know if I did something wrong but I had always the Net::SSH::AuthenticationFailed error then I gave up. Now I'm trying with Plink (a command-line interface to the PuTTY back ends). On the shell I do like this: plink -ssh user@XX.XX.XXX.XX User Name: Password: Commands... Now I need call and interact with Plink on Ruby. My last try was this: IO.popen "plink -ssh user@#{CISCO}", 'w+' do |io| io.each do |line| puts line if line.include?('User Name') io.write(USER) elsif line.include?('Password') io.write(PASS) end end end and the error was: 'write': Broken pipe What am I doing wrong? -- Posted via http://www.ruby-forum.com/.