From 11890b660b8fd5945f6829038abc7d5979b28937 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Wed, 9 Aug 2017 14:32:18 -0400 Subject: [PATCH 1/2] 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"; From d8600c25c117ee26a579eab3f9ac059d24148c6e Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Thu, 10 Aug 2017 11:08:41 -0400 Subject: [PATCH 2/2] Modify the comments --- xCAT-server/share/xcat/cons/openbmc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/cons/openbmc b/xCAT-server/share/xcat/cons/openbmc index 2bda67133..52160df8e 100755 --- a/xCAT-server/share/xcat/cons/openbmc +++ b/xCAT-server/share/xcat/cons/openbmc @@ -91,10 +91,13 @@ if ($ENV{SSHCONSOLEPORT}) { $sshport= $ENV{SSHCONSOLEPORT}; } -#user needs to download sshpass rpm if need to use it +# To automatically connect to the console without the need to send over the ssh keys, +# ensure sshpass is installed on the Management and/or Service Nodes. if (-x '/usr/bin/sshpass') { exec "/usr/bin/sshpass -p $password ssh -p $sshport -l $username $bmcip"; } else { + # This will prompt the user to enter the password for the BMC + # if ssh keys are not sent and sshpass is not being used exec "ssh -p $sshport -l $username $bmcip"; }