This Plugin was derived from the very cool SCP Plugin.
You can use the SSH Plugin to run shell commands on a remote machine via ssh.
First go to the global configuration page and add a SSH site.
For your job select a configured site and enter the shell commands that should be executed before and after the build.
Log will look like this.
[JENKINS-19973] Option to hide ssh command in log
[JENKINS-46172] Handle NPE when not all fields are specified & save only properly configured sites
INFO: the "Add Credentials" button for SSH Site don't work in recent Jenkins 2.x versions - this will be fixed in upcoming 3.0 version.
(major version since plugin will have to migrate it's configuration to new format)
[JENKINS-21436] Integrate with the SSH Credentials Plugin; previous credentials are migrated
[JENKINS-23231] Add timeout parameter
[JENKINS-24913] Don't show sensitive build variables in console log
[JENKINS-12191] Restore resolving hostname from environment variables
[JENKINS-12191] Support build variables (substitution variables) during command execution (env variables are exported before the script)
[JENKINS-24402] Updated to latest version of JSch (0.1.54) to support modern algorithms
Pull JSch dependency via Jenkins hosted jsch-plugin to use recommended way of getting common dependencies in Jenkins
Set Jenkins 1.609.3 as the oldest supported version
Show warning for missing parameters during ajax form validation
Fix security issue
Due to added integration with SSH Credentials Plugin, this version might NOT be fully compatibile with previous version. Sorry!
Please backup your org.jvnet.hudson.plugins.SSHBuildWrapper.xml before upgrading to version 2.5.