diff --git a/ui/commands/ssh.js b/ui/commands/ssh.js
index 897db5da..21f0787c 100644
--- a/ui/commands/ssh.js
+++ b/ui/commands/ssh.js
@@ -324,10 +324,17 @@ const initialFieldDef = {
"Private Key": {
name: "Private Key",
description:
- "Like the one inside ~/.ssh/id_rsa, can't be encrypted
" +
- "To decrypt the Private Key, use command: " +
- "openssl rsa -in /path/to/encrypted_private_key -out " +
- "/path/to/decrypted_private_key",
+ 'Like the one inside ' +
+ "~/.ssh/id_rsa, can't be encrypted
" +
+ 'To decrypt the Private Key, use command: ssh-keygen -f /path/to/private_key -p
' +
+ "
" +
+ "It is strongly recommanded to use one Private Key per SSH server if " +
+ "the Private Key will be submitted to Sshwifty. To generate a new SSH " +
+ 'key pair, use command ' +
+ "ssh-keygen -o -f /path/to/my_server_key and then deploy the " +
+ 'generated ' +
+ "/path/to/my_server_key.pub file onto the target SSH server",
type: "textfile",
value: "",
example: "",
@@ -342,10 +349,17 @@ const initialFieldDef = {
);
}
- let lines = d.split("\n");
+ const lines = d.trim().split("\n");
+ let firstLineReaded = false;
for (let i in lines) {
- if (lines[i].indexOf("-") === 0) {
+ if (!firstLineReaded && lines[i].indexOf("-") === 0) {
+ firstLineReaded = true;
+
+ if (lines[i].indexOf("RSA") < 0) {
+ break;
+ }
+
continue;
}