From 11890b660b8fd5945f6829038abc7d5979b28937 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Wed, 9 Aug 2017 14:32:18 -0400 Subject: [PATCH] using sshpass (if availble) connect to openbmc console --- xCAT-server/share/xcat/cons/openbmc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/cons/openbmc b/xCAT-server/share/xcat/cons/openbmc index 6d166a7d9..2bda67133 100755 --- a/xCAT-server/share/xcat/cons/openbmc +++ b/xCAT-server/share/xcat/cons/openbmc @@ -91,7 +91,12 @@ if ($ENV{SSHCONSOLEPORT}) { $sshport= $ENV{SSHCONSOLEPORT}; } -print "If the console cannot connect, please verify whether ssh keys has been configured on the bmc for $username user\n"; +#user needs to download sshpass rpm if need to use it +if (-x '/usr/bin/sshpass') { + exec "/usr/bin/sshpass -p $password ssh -p $sshport -l $username $bmcip"; +} else { + exec "ssh -p $sshport -l $username $bmcip"; +} + -exec "ssh -p $sshport -l $username $bmcip";