From 72a4fb26446f74903e69b75a69c45d58500d6d19 Mon Sep 17 00:00:00 2001 From: ja-frog <31773963+ja-frog@users.noreply.github.com> Date: Mon, 9 Apr 2018 15:40:16 -0500 Subject: Add handling for devices that only prompt for a password via SSH An approach to handling devices that do not prompt for a username, only a password when connecting via ssh. The Calix B6 inspired this. --- lib/oxidized/input/ssh.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/oxidized') diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb index 27e81e0..d84b349 100644 --- a/lib/oxidized/input/ssh.rb +++ b/lib/oxidized/input/ssh.rb @@ -123,6 +123,11 @@ module Oxidized cmd @node.auth[:username], password cmd @node.auth[:password] end + elsif @password + match = expect password, @node.prompt + if match == password + cmd @node.auth[:password] + end else expect @node.prompt end -- cgit v1.2.1