How to do it...

  1. The first step to getting SSHd Shell to work is to add the necessary dependency starters to our build.gradle file, as follows:
dependencies { 
    ... 
    compile("org.springframework.boot:spring-boot-starter-actuator") 
    compile("io.github.anand1st:sshd-shell-spring-boot-starter:3.2.1") 
    compile("de.codecentric:spring-boot-admin-starter-client:2.0.0-SNAPSHOT") 
    compile("org.jolokia:jolokia-core:+") 
    ... 
} 
  1. We also need to explicitly enable it by setting the following property in application.properties, located in the src/main/resources directory in the root of our project it needs to be enhanced with the following entries:
sshd.shell.enabled=true 
management.endpoint.shutdown.enabled=true
  1. Now, let's start our application by executing ...

Get Developing Java Applications with Spring and Spring Boot now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.