From de35cb0168834c23c0f64c0d40a3ef6c4337e2dc Mon Sep 17 00:00:00 2001 From: Zoe <124623481+ZoeWithTheE@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:00:07 -0700 Subject: [PATCH 1/3] Fix fatal SSH starting error & correct comment Fixed a fatal starting error that occurred when obtaining the example server-private-key value. this was removed for another reason, instead of being fixed: using the system SSH rsa key could be considered bad practice due to the insecurities of using the same key twice. in the event someone (maybe by the web gui) gets the key, that same key can be used as a system console assuming SSH was enabled on the host machine. --- .../java/com/osiris/autoplug/client/configs/SSHConfig.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/com/osiris/autoplug/client/configs/SSHConfig.java b/src/main/java/com/osiris/autoplug/client/configs/SSHConfig.java index f8f9ce3..b5317c1 100644 --- a/src/main/java/com/osiris/autoplug/client/configs/SSHConfig.java +++ b/src/main/java/com/osiris/autoplug/client/configs/SSHConfig.java @@ -93,8 +93,6 @@ public SSHConfig() throws IOException, DuplicateKeyException, YamlReaderExceptio "The generated file will be a .pub file, which contains the public key.", "Example connection command: `ssh -i /path/to/private/key username@server-ip-address`"); - - String sshPath = OSUtils.IS_WINDOWS ? "%USERPROFILE%\\.ssh\\id_rsa" : "~/.ssh/id_rsa"; server_private_key = put("server-private-key") .setComments( "The private key used by the server to authenticate itself to the SSH console.", @@ -105,7 +103,7 @@ public SSHConfig() throws IOException, DuplicateKeyException, YamlReaderExceptio "In the same directory as the private key, there will also need to be a file with the same name and a .pub extension, which contains the public key.", "NOTICE: The .ssh directory is not present by default, and must be created via the usage of the 'ssh-keygen' command.", "Example:", - "server-private-key: " + sshPath); + "server-private-key: ./autoplug/id_rsa"); username = put(name, "username").setDefValues("autoplug") .setComments( From cb0ad3256f3130abbc8b4bc0ebbcc614d57f8281 Mon Sep 17 00:00:00 2001 From: Zoe <174354408+Proj-Daedalus@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:26:57 -0700 Subject: [PATCH 2/3] removed import (not needed) --- src/main/java/com/osiris/autoplug/client/configs/SSHConfig.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/osiris/autoplug/client/configs/SSHConfig.java b/src/main/java/com/osiris/autoplug/client/configs/SSHConfig.java index b5317c1..704a122 100644 --- a/src/main/java/com/osiris/autoplug/client/configs/SSHConfig.java +++ b/src/main/java/com/osiris/autoplug/client/configs/SSHConfig.java @@ -10,8 +10,6 @@ import java.io.IOException; -import org.jline.utils.OSUtils; - import com.osiris.autoplug.client.tasks.SSHManager; import com.osiris.dyml.Yaml; import com.osiris.dyml.YamlSection; From 6afeebdbf51c9b369a3adeedcbf8be666e416277 Mon Sep 17 00:00:00 2001 From: Zoe <174354408+Proj-Daedalus@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:38:42 -0700 Subject: [PATCH 3/3] fixed server_private_key not in ssh yml section --- src/main/java/com/osiris/autoplug/client/configs/SSHConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/osiris/autoplug/client/configs/SSHConfig.java b/src/main/java/com/osiris/autoplug/client/configs/SSHConfig.java index 704a122..60903d0 100644 --- a/src/main/java/com/osiris/autoplug/client/configs/SSHConfig.java +++ b/src/main/java/com/osiris/autoplug/client/configs/SSHConfig.java @@ -91,7 +91,7 @@ public SSHConfig() throws IOException, DuplicateKeyException, YamlReaderExceptio "The generated file will be a .pub file, which contains the public key.", "Example connection command: `ssh -i /path/to/private/key username@server-ip-address`"); - server_private_key = put("server-private-key") + server_private_key = put(name, "server-private-key") .setComments( "The private key used by the server to authenticate itself to the SSH console.", "The file must be in the OpenSSH format.",