Jenkins Disable CLI over Remoting via a Groovy Script
you can do it like this (jenkins2.60.2)
import jenkins.model.Jenkinsjenkins.model.Jenkins.instance.getDescriptor("jenkins.CLI").get().setEnabled(false)
Regards
Create the file $JENKINS_HOME/jenkins.CLI.xml
with the following content:
<?xml version='1.0' encoding='UTF-8'?><jenkins.CLI> <enabled>false</enabled></jenkins.CLI>
It will behave as if you pressed the "Disable Jenkins CLI over Remoting" button in the Jenkins GUI once the server restarts.
juhnz's answer covers disabling the CLI completely. However, I believe the intent of the question was just disable the Jenkins CLI over remoting, only, but otherwise enable the CLI.