Created
November 10, 2016 16:15
-
-
Save hartzell/4a1923ec51350ffd2a3de4e5118fc2e3 to your computer and use it in GitHub Desktop.
A groovy script to disable the built-in sshd server in Jenkins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Drop this into init.groovy.d so that it gets executed at startup time. | |
// One could also use this script to explicitly set a port. | |
def inst = Jenkins.getInstance() | |
def sshDesc = inst.getDescriptor("org.jenkinsci.main.modules.sshd.SSHD") | |
sshDesc.setPort(-1) | |
sshDesc.getActualPort() | |
sshDesc.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment