2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-31 10:06:39 +00:00

using sshpass (if availble) connect to openbmc console

This commit is contained in:
Casandra Qiu 2017-08-09 14:32:18 -04:00
parent 98f1e5c0a3
commit 11890b660b

View File

@ -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";