String setupTtyScriptName = Configuration.getString(Constants.SERENGETI_SETUP_LOGIN_TTY_SCRIPT, Constants.SERENGETI_DEFAULT_SETUP_LOGIN_TTY_SCRIPT);
String setupTtyScript = getScriptName(setupTtyScriptName);
String cmd = "sudo " + setupTtyScript;
String action = "Setup login tty for " + nodeIP;
logger.info(action + " command is: " + cmd);
SSHUtil sshUtil = new SSHUtil();
String errMsg = null;
for (int i = 0; i < Constants.SET_PASSWORD_MAX_RETRY_TIMES; i++) {
try {
if (sshUtil.execCmd(sshUser, privateKeyFile, nodeIP, sshPort, cmd, null, null)) {
logger.info(action + " succeed.");
return;
}
} catch (JSchException e) {
logger.warn("Got exception when " + action, e);