From 447981a57efac550f42f9922b267cf2da36970d5 Mon Sep 17 00:00:00 2001 From: Toby Lin Date: Thu, 22 Apr 2021 17:15:32 +0000 Subject: [PATCH] Better error message for missing ssh keys --- mitm/keys.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mitm/keys.js b/mitm/keys.js index 14bf08a..b6ca229 100644 --- a/mitm/keys.js +++ b/mitm/keys.js @@ -49,7 +49,11 @@ function loadKeys(mountPath, ctID, cb) { keys = readCTKeys(mountPath, ctID); } catch (e) { console.log(e); - console.log("CRITICAL ERROR: Could not read the keys from the container! Is the container mounted?"); + if (e.code === 'EACCES') { + console.log("CRITICAL ERROR: Could not read the keys from the container! Permission denied, are you the root user?"); + } else { + console.log("CRITICAL ERROR: Could not read the keys from the container! Is the container mounted/running and is openssh-server installed?"); + } process.exit(1); } return cb(keys);