From be9c53bf6f1eeaf4b4f31d180bcfeca730796a05 Mon Sep 17 00:00:00 2001 From: Ryan Michela Date: Sun, 3 Aug 2014 13:20:00 -0700 Subject: [PATCH] Added specific interface binding --- pom.xml | 2 +- src/main/java/com/ryanmichela/sshd/SshdPlugin.java | 2 ++ src/main/resources/config.yml | 6 ++++-- src/main/resources/plugin.yml | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 54f10fc..f3f63cc 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.ryanmichela SSHD - 1.1 + 1.1.1 http://dev.bukkit.org/server-mods/sshd/ diff --git a/src/main/java/com/ryanmichela/sshd/SshdPlugin.java b/src/main/java/com/ryanmichela/sshd/SshdPlugin.java index 8d2c1b6..96288f7 100644 --- a/src/main/java/com/ryanmichela/sshd/SshdPlugin.java +++ b/src/main/java/com/ryanmichela/sshd/SshdPlugin.java @@ -35,6 +35,8 @@ public class SshdPlugin extends JavaPlugin { sshd = SshServer.setUpDefaultServer(); sshd.setPort(getConfig().getInt("port", 22)); + String host = getConfig().getString("host", ""); + sshd.setHost(host == "" ? null : host); File hostKey = new File(getDataFolder(), "hostkey"); File authorizedKeys = new File(getDataFolder(), "authorized_keys"); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 1c29280..6c00aa5 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1,4 +1,6 @@ -# This is the port the SSH server will listen on. +# The interface the SSH server will listen on. Leave blank for all interfaces. +host: +# The port the SSH server will listen on. port: 22 # By default, only public key authentication is enabled. This is the most secure mode. @@ -9,4 +11,4 @@ port: 22 # For less secure username and password based authentication, complete the sections below. credentials: # user1: password1 -# user2: password2 \ No newline at end of file +# user2: password2 diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index de1a15e..f036090 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,4 +1,4 @@ name: SSHD -version: "1.1" +version: "1.1.1" author: Ryan Michela main: com.ryanmichela.sshd.SshdPlugin \ No newline at end of file