Skip to end of metadata
Go to start of metadata

Plugin Information

View SSH Slaves on the plugin site for more information.

Older versions of this plugin may not be safe to use. Please review the following warnings before using an older version:

SSH Slaves plugin

This plugin allows you to manage agents running on *nix machines over SSH.

Documentation

 

28 Comments

  1. Unknown User (brucepainter64@gmail.com)

    Anyway to get this page updated with the changes between versions?

  2. Unknown User (michal huniewicz)

    I seem to be unable to upgrade to the latest (0.5.1) version.

    I have version 0.4 now and whenever I ask Hudson to update it and restart, it still says I have 0.4 and that I should update.

    Does anyone have a similiar issue?

  3. Unknown User (brucepainter64@gmail.com)

    This appears to be a known issue:

    http://www.nabble.com/-Issue-3662--New---pom.xml-keeps-0.4-as-version-td23479562.html

    You can manually get the updated plugin by going to:

    https://hudson.dev.java.net/servlets/ProjectDocumentList?folderID=9380

    Then install it through the Plugin Manager -> Advanced Tab

    1. Unknown User (krystian)

  4. Where can you post support questions for this plugin?

  5. Unknown User (gary.mann@baml.com)

    Hi everyone,

    I'm using the SSH slaves plugin (0.13) on a Windows master (Windows Server 2003, Apache Tomcat), and I'm trying to connect to a new RHEL5.0 Linux slave. I have other Linux slaves (RHEL4u5), and these all work fine with user/password authentication. However, I can't get this new slave to connect, and I simply get this error message:

    [10/14/10 18:23:55] [SSH] Opening SSH connection to hostname:22.
    [10/14/10 18:23:56] [SSH] Authenticating as username/******.
    java.io.IOException: Password authentication failed.
        at com.trilead.ssh2.auth.AuthenticationManager.authenticatePassword(AuthenticationManager.java:319)
        at com.trilead.ssh2.Connection.authenticateWithPassword(Connection.java:314)
        at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:560)
        at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:174)
        at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:184)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: Authentication method password not supported by the server at this stage.
        at com.trilead.ssh2.auth.AuthenticationManager.authenticatePassword(AuthenticationManager.java:289)
        ... 9 more
    [10/14/10 18:23:56] [SSH] Connection closed.

    At this point I'm completely stuck, and not sure where to go next. Google reveals many people with similar issues, but no solutions.

    A few things spring to mind. Firstly, my RHEL5 slave has a 2048 bit SSH key, whereas the RHEL4 slaves have 1024 bit keys.Could there be an issue with the embedded SSH client?

    Secondly, I'm not sure how to set up SSH properly as I'm unsure as to where the RSA keys used by the Hudson SSH client are kept (assuming they're completely unrelated to Cygwin/Putty).

    Has anyone else out there with the same issue managed to find a solution?

    Thanks in advance,

    Gary

    1. Unknown User (gary.mann@baml.com)

      Hello everyone again,

      I've just found the solution to this issue - essentially it's to do with the way that sshd is configured. I'm not sure if this is a default in RHEL5, or whether this is my company's site configuration, but it all hinges on the following line in /etc/sshd_config (or /etc/ssh/sshd_config):

      # To disable tunneled clear text passwords, change to no here!
      PasswordAuthentication no

      If set to no, Hudson's SSH client won't be able to connect using password authentication. If you comment this line out (which I believe is the OpenSSH default), or set it to yes, then Hudson can connect just fine.

      Hope this helps anyone else with the same issue,

      Gary

      1. It absolutely helped me. Thanks!

  6. Is there a way to have this plugin use the socket of the ssh-agent? I have set the SSH_AUTH_SOCK environment variable and ForwardAgent option, but it seems useless.

    I'm going to have many slaves, and I don't want to copy Jenkins' private key on them, just to enable git access through ssh.

    1. Command execution solved the problem.

  7. Is it possible to configure the port from which the Master will connect to the slave? By default the port is random.

    Thanks

  8. 01/10/12 09:58:30] [SSH] Opening SSH connection to <server name>:22.
    hudson.AbortException: The server doesn't support the password authentication
    at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:699)
    at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:283)
    at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:200)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    [01/10/12 09:58:30] [SSH] Connection closed.

    Hi,After a recent unix server upgrade to our slaves, Hudson now fails to connect over SSH to them with the above message. I believe the issue to be that given the new servers now only support keyboard-interactive authentication, not password anymore, the connection fails. Can we add support to the plugin to either choose an authentication type or failover to keyboard-interactive if password fails? Internally, for other apps, using the same ganymed*. ssh library we've added the same fallback and its a very easy code change .Something like:

     if(connection.isAuthMethodAvailable(usr, "password")){
                            connection.authenticateWithPassword(usr, pwd);
                         } else if(connection.isAuthMethodAvailable(usr, "keyboard-interactive")){
                               connection.authenticateWithKeyboardInteractive(usr, new InteractiveCallback(){
    
  9. Is this not supported on the latest version of Jenkins? It isn't showing up in my "available plugins" list.

  10. I am trying (for the first time) to get a Windows Master to use a Linux slave.

    "Start by SSH" doesn't appear in the new node pull down, so I went looking for the SSH plugin . . . found it, it was disabled so I enabled it.

    On Jenkins restart it disabled itself again.  Upgraded to latest (.22) . . . but same result.

    Is there something I need to install on Windows?

    Frank

  11. After upgrading our ssh slaves & ssh credentials plugin to latest, *all* slaves are unavailable. Did someone meet such behavior?

    1. Well I have the same problem here. No credentials are available anymore. The dropdown box is empty. Although multiple non-domain credentials are defined.

      1. It looks like as if the SSH plugin only finds SSH Key based credentials. Username/password are ignored. But when I specify a key credentials it fails with a different exception:26:30 SSH Opening SSH connection to xxx.intra:22.
        ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins.
        java.lang.NoSuchMethodError: com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(Ljava/lang/Object;Lcom/cloudbees/jenkins/plugins/sshcredentials/SSHUser;)Lcom/cloudbees/jenkins/plugins/sshcredentials/SSHAuthenticator;
        at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:949)
        at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:488)
        at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:230)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)
        26:30 SSH Connection closed.

  12. I am trying to use this plugin in conjunction with the Multi slave config plugin https://wiki.jenkins-ci.org/display/JENKINS/Multi+slave+config+plugin. Unfortunately, it does not seem to be possible to generate several slaves with different host names. Or am I doing something wrong? This would be a great enhancement of the plugin!

  13. Version 1.7 seems to have introduced a bug. We're getting NullPointerException at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1198). Downgrading to version 1.6 fixes this issue.

    Our Jenkins version is 1.565.2 LTS.

    1. Same behavior on my side. Using latest Jenkins version 1.582

  14. Is there any change to use different SSH credentials to launch the same slave in different jobs?

    For example you have the slave "unix1" that might be used for the job A and B, but job A should use ssh-key-A while job B should use ssh-key-B ... the choice which key to be used might be fixed for a job or might be given as a build parameter.

  15. Where is a 'Once it has a suitable version of java' defined? I need to incorporate some very odd / old slaves.  And i want to make sure I don't run foul of need an unsupported version of java.  

  16. To the author of this plugin. It would be appreciated if the plugin was placed under some kind of license.

    MIT License is the most common for Jenkins plugins.

  17. You should document the way to add host to known_hosts when using version >= 1.15. 

    If the user running jenkins do not have a shell, the following command can be used with openssh on linux:

    mkdir -p /var/lib/jenkins/.ssh
    chmod 700 /var/lib/jenkins/.ssh
    ssh-keyscan -H <hostname> >> /var/lib/jenkins/.ssh/known_hosts
    chown -R jenkins /var/lib/jenkins/.ssh
  18. is there a way to bypass java version validation?

    I need to ssh to a PowerPC Device running Linux without Java.

    The connection was initially succesful. However connection was closed due to failure to find java on the slave device.

    Below is the log file. Appreciate any help.

    [06/16/17 22:37:41] [SSH] Opening SSH connection to joker:22.
    
    [06/16/17 22:37:43] [SSH] WARNING: SSH Host Keys are not being verified. Man-in-the-middle attacks may be possible against this connection.
    
    [06/16/17 22:37:44] [SSH] Authentication successful.
    [06/16/17 22:37:45] [SSH] The remote users environment is:
    BASH=/bin/bash
    BASHOPTS=cmdhist:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
    BASH_ALIASES=()
    BASH_ARGC=()
    BASH_ARGV=()
    BASH_CMDS=()
    BASH_EXECUTION_STRING=set
    BASH_LINENO=()
    BASH_SOURCE=()
    BASH_VERSINFO=([0]="4" [1]="2" [2]="37" [3]="1" [4]="release" [5]="powerpc-unknown-linux-gnu")
    BASH_VERSION='4.2.37(1)-release'
    DIRSTACK=()
    EUID=0
    GROUPS=()
    HOME=/root
    HOSTNAME=Joker
    HOSTTYPE=powerpc
    IFS=$' \t\n'
    LC_ALL=C
    LOGNAME=root
    LS_COLORS=
    LS_OPTIONS=--color=auto
    MACHTYPE=powerpc-unknown-linux-gnu
    MAIL=/var/mail/root
    OPTERR=1
    OPTIND=1
    OSTYPE=linux-gnu
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
    PERLLIB=/usr/local/NSPT/WDSafe/lib:/usr/local/NSPT/WDShare/lib:/usr/local/NSPT/WDNAS/lib:
    PERLLIB_ALL_PATHS=([0]="/usr/local/NSPT/WDSafe/lib:/usr/local/NSPT/WDShare/lib:/usr/local/NSPT/WDNAS/lib:")
    PERLLIB_PATH=/usr/local/NSPT/WDSafe/lib
    PERLLIB_PATHS=([0]="/usr/local/NSPT/WDNAS/lib" [1]="/usr/local/NSPT/WDShare/lib" [2]="/usr/local/NSPT/WDSafe/lib")
    PIPESTATUS=([0]="0")
    PPID=5512
    PS1='\h:\w\$ '
    PS4='+ '
    PWD=/root
    SHELL=/bin/bash
    SHELLOPTS=braceexpand:hashall:interactive-comments
    SHLVL=1
    SSH_CLIENT='192.168.0.7 50476 22'
    SSH_CONNECTION='192.168.0.7 50476 192.168.0.6 22'
    TERM=dumb
    UID=0
    USER=root
    WDPERLLIB=/usr/local/NSPT/WDSafe/lib:/usr/local/NSPT/WDShare/lib:/usr/local/NSPT/WDNAS/lib:
    _=/etc/nas/NSPT/setPerlVar
    [06/16/17 22:37:45] [SSH] Checking java version of java
    Couldn't figure out the Java version of java
    bash: java: command not found
    
    [06/16/17 22:37:45] [SSH] Checking java version of /usr/bin/java
    Couldn't figure out the Java version of /usr/bin/java
    bash: /usr/bin/java: No such file or directory
    
    [06/16/17 22:37:45] [SSH] Checking java version of /usr/java/default/bin/java
    Couldn't figure out the Java version of /usr/java/default/bin/java
    bash: /usr/java/default/bin/java: No such file or directory
    
    [06/16/17 22:37:45] [SSH] Checking java version of /usr/java/latest/bin/java
    Couldn't figure out the Java version of /usr/java/latest/bin/java
    bash: /usr/java/latest/bin/java: No such file or directory
    
    [06/16/17 22:37:45] [SSH] Checking java version of /usr/local/bin/java
    Couldn't figure out the Java version of /usr/local/bin/java
    bash: /usr/local/bin/java: No such file or directory
    
    [06/16/17 22:37:45] [SSH] Checking java version of /usr/local/java/bin/java
    Couldn't figure out the Java version of /usr/local/java/bin/java
    bash: /usr/local/java/bin/java: No such file or directory
    
    [06/16/17 22:37:45] [SSH] Checking java version of /jdk/bin/java
    Couldn't figure out the Java version of /jdk/bin/java
    bash: /jdk/bin/java: No such file or directory
    
    Linux Joker 2.6.32.11-svn70860 #1 Thu May 17 13:32:51 PDT 2012 ppc GNU/Linux
    java.io.IOException: Could not find any known supported java version in [java, /usr/bin/java, /usr/java/default/bin/java, /usr/java/latest/bin/java, /usr/local/bin/java, /usr/local/java/bin/java, /jdk/bin/java], and we also failed to install JDK as a fallback
    	at hudson.plugins.sshslaves.SSHLauncher.resolveJava(SSHLauncher.java:914)
    	at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:808)
    	at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:792)
    	at java.util.concurrent.FutureTask.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: Failed to detect the environment for automatic JDK installation. Please report this to jenkinsci-users@googlegroups.com: Linux Joker 2.6.32.11-svn70860 #1 Thu May 17 13:32:51 PDT 2012 ppc GNU/Linux
    
    	at hudson.plugins.sshslaves.SSHLauncher.attemptToInstallJDK(SSHLauncher.java:1025)
    	at hudson.plugins.sshslaves.SSHLauncher.resolveJava(SSHLauncher.java:912)
    	... 6 more
    [06/16/17 22:37:45] Launch failed - cleaning up connection
    [06/16/17 22:37:45] [SSH] Connection closed.
  19. Hi! I am trying to set environment variable in master as "SLAVE_IP" with an IP address as a value and use it in Slave(Both master and slave in windows) but somehow it won't recognize the environment variable though it is displayed in system configuration. While launching the agent it gives me error as:

    [10/17/17 15:11:22] [SSH] Opening SSH connection to ${SLAVE_IP}:22.
    
    ${SLAVE_IP}
    java.io.IOException: There was a problem while connecting to ${SLAVE_IP}:22
    	at com.trilead.ssh2.Connection.connect(Connection.java:834)
    	at com.trilead.ssh2.Connection.connect(Connection.java:703)
    	at com.trilead.ssh2.Connection.connect(Connection.java:617)
    	at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1284)
    	at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:804)
    	at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:793)
    	at java.util.concurrent.FutureTask.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.UnknownHostException: ${SLAVE_IP}
    	at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    	at java.net.InetAddress$2.lookupAllHostAddr(Unknown Source)
    	at java.net.InetAddress.getAddressesFromNameService(Unknown Source)
    	at java.net.InetAddress.getAllByName0(Unknown Source)
    	at java.net.InetAddress.getAllByName(Unknown Source)
    	at java.net.InetAddress.getAllByName(Unknown Source)
    	at java.net.InetAddress.getByName(Unknown Source)
    	at com.trilead.ssh2.transport.TransportManager.createInetAddress(TransportManager.java:166)
    	at com.trilead.ssh2.transport.TransportManager.establishConnection(TransportManager.java:366)
    	at com.trilead.ssh2.transport.TransportManager.initialize(TransportManager.java:480)
    	at com.trilead.ssh2.Connection.connect(Connection.java:774)
    	... 9 more
    [10/17/17 15:11:25] Launch failed - cleaning up connection
    [10/17/17 15:11:25] [SSH] Connection closed.
  20. Do you support openjdk 1.8.0.171 ??

  21. Trying to connect to a node which is behind a Socks proxy with JVM options but yet it's unable to connect. Any help will be appreciated.
    Reference: https://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html

    SSHLauncher{host='HOST', port=22, credentialsId='Id', jvmOptions='java -DsocksProxyHost=Socksproxy -DsocksProxyPort=1080 -DsocksProxyVersion=5 -Djava.net.socks.username=USERNAME -Djava.net.socks.password=PASSWORD -jar jenkins.war', javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=210, maxNumRetries=1, retryWaitTime=15, sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy, tcpNoDelay=true, trackCredentials=true}
    [09/17/18 16:39:30] [SSH] Opening SSH connection to HOST:22.
    Connection timed out: connect
    SSH Connection failed with IOException: "Connection timed out: connect", retrying in 15 seconds. There are 1 more retries left.