Managing Spring Boot via SSHd Shell and writing custom remote Shell commands
Some of you are probably reminiscing about the good old days where all the administration was done via SSH directly on the machine, where one has complete flexibility and control, or even using SSH to connect to a management port and apply whatever changes were needed directly to a running application. Even though Spring Boot has removed native integration with the CRaSH Java Shell in version 2.0, there is an open source project, sshd-shell-spring-boot
, which brings back that ability.
For this recipe, we will use the health indicator and management endpoint, which we created earlier in this chapter. We will expose the same capabilities via the SSH console access.
How to do it...
- 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...