1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Added option to save SSH username and key without saving key password.

This commit is contained in:
Ylian Saint-Hilaire 2022-05-10 17:44:34 -07:00
parent b76b6816cd
commit 0d297088c8
7 changed files with 328 additions and 93 deletions

View file

@ -729,7 +729,16 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
if (docs[i].pmt != null) { docs[i].pmt = 1; }
// Remove SSH credentials if present
if (docs[i].ssh != null) { docs[i].ssh = (docs[i].ssh.k) ? 2 : 1; }
if (docs[i].ssh != null) {
if (docs[i].ssh.u) {
if (docs[i].ssh.k && docs[i].ssh.kp) { docs[i].ssh = 2; } // Username, key and password
else if (docs[i].ssh.k) { docs[i].ssh = 3; } // Username and key. No password.
else if (docs[i].ssh.p) { docs[i].ssh = 1; } // Username and password
else { delete docs[i].ssh; }
} else {
delete docs[i].ssh;
}
}
// Remove RDP credentials if present
if (docs[i].rdp != null) { docs[i].rdp = 1; }