From: KING SABRI Date: 2011-10-26T18:20:33+09:00 Subject: How to SSH interactive Session Good day everyone I need to execute command on linux machine this command is interactive command. Interactive command means require input like [yes , no] or password twice my real case is. I create a script execute commands and get the outputs successfully. but some servers has Loging password expired so I need to interact with server to send the current password + the new password(twice) ---------------------------- ssh userName@10.0.0.243 userName@10.0.0.243's password: You are required to change your password immediately (password aged) Last login: Sun Aug 7 13:15:40 2011 from 10.0.0.28 WARNING: Your password has expired. You must change your password now and login again! Changing password for user userName. Changing password for userName (current) UNIX password: New UNIX password: Retype new UNIX password: ---------------------------- Notice: - I've no problem in executing command in normal case - please, I have to avoid workarounds like (echo "pass" | ssh -S) to make me pass any other interactive situations. - I'm using 'net/ssh' libs so please advice Appreciate your help in advance -- Posted via http://www.ruby-forum.com/.