diff --git a/pom.xml b/pom.xml index 9b71dae..94c531f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.example.sshd echo-sshd-server - 1.0.0 + 1.0.1 ECHO SSH SERVER Learning Apache Mina SSHD library diff --git a/src/main/java/com/example/sshd/config/SshConfig.java b/src/main/java/com/example/sshd/config/SshConfig.java index f2ff6b0..be51a98 100644 --- a/src/main/java/com/example/sshd/config/SshConfig.java +++ b/src/main/java/com/example/sshd/config/SshConfig.java @@ -9,6 +9,8 @@ import org.apache.sshd.SshServer; import org.apache.sshd.server.PasswordAuthenticator; import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider; import org.apache.sshd.server.session.ServerSession; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -16,6 +18,8 @@ import org.springframework.context.annotation.Configuration; @Configuration public class SshConfig { + private static final Logger logger = LoggerFactory.getLogger(SshConfig.class); + @Value("${ssh-server.port}") private int port; @@ -34,6 +38,7 @@ public class SshConfig { sshd.setPasswordAuthenticator(new PasswordAuthenticator() { @Override public boolean authenticate(final String username, final String password, final ServerSession session) { + logger.info("Login Attempt: username = {}, password = {}", username, password); return StringUtils.equals(username, rootUsername); } });