Skip to content

Commit 6478457

Browse files
committed
Added info logging for auth fails.
Added info logging when authentication fails. Can enable info level in log4j.xml.
1 parent 1b31778 commit 6478457

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/main/java/com/keybox/manage/util/SSHUtil.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ public static HostSystem authAndAddPubKey(HostSystem hostSystem, String passphra
233233
addPubKey(hostSystem, session, appKey.getPublicKey());
234234

235235
} catch (Exception e) {
236+
log.info(e.toString(), e);
236237
hostSystem.setErrorMsg(e.getMessage());
237238
if (e.getMessage().toLowerCase().contains("userauth fail")) {
238239
hostSystem.setStatusCd(HostSystem.PUBLIC_KEY_FAIL_STATUS);
@@ -292,6 +293,7 @@ public static HostSystem pushUpload(HostSystem hostSystem, Session session, Stri
292293
file.close();
293294

294295
} catch (Exception e) {
296+
log.info(e.toString(), e);
295297
hostSystem.setErrorMsg(e.getMessage());
296298
hostSystem.setStatusCd(HostSystem.GENERIC_FAIL_STATUS);
297299
}
@@ -375,6 +377,7 @@ public static HostSystem addPubKey(HostSystem hostSystem, Session session, Strin
375377
}
376378

377379
} catch (Exception e) {
380+
log.info(e.toString(), e);
378381
hostSystem.setErrorMsg(e.getMessage());
379382
hostSystem.setStatusCd(HostSystem.GENERIC_FAIL_STATUS);
380383
}
@@ -490,6 +493,7 @@ public static HostSystem openSSHTermOnSystem(String passphrase, String password,
490493

491494

492495
} catch (Exception e) {
496+
log.info(e.toString(), e);
493497
hostSystem.setErrorMsg(e.getMessage());
494498
if (e.getMessage().toLowerCase().contains("userauth fail")) {
495499
hostSystem.setStatusCd(HostSystem.PUBLIC_KEY_FAIL_STATUS);

0 commit comments

Comments
 (0)