Due to some maintenance issues, this service has been switched in read-only mode, you can find more information about the why

and how to migrate your plugin documentation in this blogpost

Skip to end of metadata
Go to start of metadata

Plugin Information

View SCP publisher on the plugin site for more information.

The current version of this plugin may not be safe to use. Please review the following warnings before use:

This plugin uploads build artifacts to repository sites using SCP (SSH) protocol. First you should define SCP hosts on hudson global config page. After that you can refer to this hosts using select list. See picture for global config:

After entering username/password automatic logon check is performed to see if you entered it correctly.
Root repository path must exist before you can reference it and should be accessible by user who do publish of files.

Then per job you can enable publishing of build artifacts:

Source points to files which will be uploaded. You can use ant includes syntax, eg. folder/dist/*.jar. Path is constructed from workspace root.
Note that you cannot point files outside the workspace directory. For example providing: ../myfile.txt won't work...
Destination points to destination folder on remote site. It will be created if doesn't exists and relative to root repository path.
You can define multiple blocks of source/destination pairs.

Change Log

Version 1.9 ( ? )
Version 1.8 (Jan 6, 2011)
Version 1.7 (Oct 19, 2010)
Version 1.6 (Feb 2, 2010)
  • Update code for more recent Hudson
Version 1.5.2 (Nov 12, 2008)
  • Fix for JENKINS-2609: version 1.5.1 of the SCP plugin is broken for "password only" authentication
Version 1.5.1
  • Enhancement, support for public key authentication (JENKINS-1269)
  • Enhancement, works now with Maven2 jobs (JENKINS-1845)
Version 1.5
  • Improved error diagnosis when the specified file pattern didn't match anything.
Version 1.4 (2008/07/23)
Version 1.3
  • fixed bug with subdirectories creation
Version 1.2


  1. Anonymous

    Can you access other job's lastSuccessful?  I want to create a new scheduled job that grabs the last successful build artifact of a particular job.  Is this possible?

    1. Unknown User (zdanek)

      Nope, you cannot. I spent some time debbuging SCP Plugin. You cannot access files outside workspace. I need version that allows it and maybe I'll fix it and put new plugin somewhere. Or Ramil will do it?

  2. Unknown User (tronda)

    Does this plugin work on Windows with Cygwin installed? If so - this should probably be mentioned on this Confluence page.

  3. Unknown User (lalford)

    If you only have a single artifact you want to copy somewhere, are there any thoughts to adding the ability to rename said artifact?  Near as I can tell, the destination only allows a relative directory path and there's no way to include a new file name.  This would be a very useful feature to me since I am using this tool to copy an artifact that has a version number in the file name (for QA and production) as well as for my development automated testing tool that would like to be version agnostic (so I don't have to change the automated tester every time the artifact version changes).

    I'm thinking something like the following, but I haven't grabbed the source yet to find out what might be involved in doing this.

    artifact name = product-1.0.ear

    source: workspace/build/artifacts/*

    destination: qa/product/1.0/product-1.0.ear

    destination: dev/product/trunk/product-trunk.ear

    (where product-*.ear is the file name, not a folder)

    1. Unknown User (adamb)

      I second this request.

  4. Unknown User (hakan008)

    This plugin is very useful, it runs on a free-style software project but fails on a maven project.

    Actually it never tries to run on a maven project, no log, no process.

    Is there a solution for this?

  5. Unknown User (peter.kahn@ironmountain.com)

    The add files option doesn't seem to provide fields for me to enter data.  I have tried this on Firfox/IE and Chrome.  Is there example xml for the config.xml so I can sneak passed this?

    1. Unknown User (citizenkahn@gmail.com)

      Never mind, it was a configuration problem.  I installed the latest plugin prior to upgrading hudson.  This made hudson incapable of editing the build configuration at all. All was fine after doing this:

      • upgrade hudson
      • disabled and re-enable plugin
  6. Unknown User (rsaddey)

    I'm impressed, it's working like a charm! Still, I'd like to propose an enhancement:

    I'd wish for an additional id field, so multiple destinations (i.e. repository paths and logins) can be set-up for the same host.

    Right now, the hostname field serves two purposes:
    1. Designate the FQDN (DSN-name or IP) of the target-host
    2. State the name for a set of repository settings (i.e. port, repository path, user, password, etc.)

    I have to admit that I don't use the SCP plugin to copy to a repository at all. Instead build artifacts are being copied to (Apache-) www-folders so they can then be downloaded and installed (.jads and .jars in my case). That's fine for a single target (i.e. repository), but appears to fail if there are numerous target directories (and each of them requiring a different login).

    Should I a dare to open an enhancement issue?

  7. Unknown User (sheibeck)

    I've got everything working brilliantly with this plugin except that it won't create subdirectories in the Source root (sad) Has anyone found a solution to this?

  8. Unknown User (dmorrow@maned.com)

    I'm trying to recursively copy over a directory from one location to another using the SCP plugin, and can't figure out how to do it with the Ant glob syntax.

    Previously, I had a shell script that would do this:

    scp -r $localFile $username@$remoteHostIP:$remoteDestDir

    This would do a full recursive copy from "localFile" (really, local-dir) to the remoteDestDir location. I don't know how to specify this with the SCP plugin. I guess I could go back to running the shell script, or have several SCP calls that copy each sub-directory over, but that seems weird.

    Any idea how I might do this?

  9. Unknown User (shannon977)

    Report an issue - SCP plug-in does not support concurrent SCP sessions.

    As Hudson support multi-executor within one slave. it means scp stands chance of being invoked simultaneously by more than one job. I am encounted to such a requirement that success of job-0 triggers job-1 and job-2, both of which employ scp as post-build action. They failed scp simultaneously. but They do succeed separately.

    I am willing to study your source codes. but I can not connect to https://svn.dev.java.net/svn/hudson/trunk/hudson/plugins/scp and I don't know why. can anyone give my a copy?

  10. Unknown User (vrspraveen.atluri@gmail.com)

    I am using this plugin in a maven project. It is working Excellent but Is there any option to run this plugin before running M2 extra build steps plugin.

  11. Unknown User (brentd)

    Hi, I am a bit new to this plugin and I want to use the "key" authentication. How do I specify the key file or where do I put it? I tried using a url but it doesn't seem to work.

  12. Unknown User (andrei.pozolotin@gmail.com)

    Hi, does this plugin has a log? where? I keep getting "Can't connect to server" for all external sites; hudson scp config page test can connect only to localhost; I also verified that I can connect to all these other sites with normal ssh client OK. Thank you.

    [SOLVED] in this case I needed to provide following line  in sshd_config: PasswordAuthentication yes
    despite this presumably being the default setting on this freebsd box and also working fine for manual logins. Cheers.

  13. Unknown User (aleori79)

    I have 2 question for the plugin developers.

    1.This pluging appears in the last section of the project's configuration form and I need it to run it before a shell

    script using shh pluging. Is it a way to change the order in which this pluging runs regards to others.

    2. Right now is only possible to choose one site peer project.  Is it a way to include the option to add more sites

    to upload to in the same project?.

    1. Unknown User (barak)

      Facing the same problem - how can one determine the order of plugin runs? Is there an open ticket for that?


  14. Unknown User (sellerjd)

    "Can't connect to server"
    Hudson is running as a war in glassfish, started by the user "glassfish".
    I'm getting this error but can't determine why. When in cli on the box in which hudson is running, I can execute:
    scp testFile root@remotebox:/tmp/
    as the glassfish user and it works fine.

    But when I try to add "remotebox" as an SCP host in hudson, I get "Can't connect to server".
    I tried the fix above, editing sshd_config for PasswordAuthentication yes but it didn't seem to help.

    Any other ideas?

  15. Unknown User (littlefatbird)

    Help me, help me, please help me, who can tell me what happened as below message...

  16. Unknown User (andrei.pozolotin@gmail.com)


    currently, if you have on source:


    and you specify:

    source: "dir1/**"
    destination "dir"

    then all contents of all folders on the source "dir1/dir2/dir3" will be flattened (merge+overwrite) inside destination "dir";

    how can you copy and preserve directory tree?

    1. Unknown User (lupsyn)

      have you fond a solutions for this ?

  17. Unknown User (gabrielbaez)

    Nice  plugin,  it would be great if it allowed you to select two different repository   to  upload to.

  18. Unknown User (ingvald)

    2 feature requests...

    • as mentioned above, the ability to save with a different name (and to put it todays date in the target name would be cool)
    • it would be practical to be able to save an artifact directly from a slave without going through the master first (f.ex. when they're on different networks)
  19. Unknown User (thebug)

    Is it possible to flatten the source folders?
    e.g. in my projects I package the outcome in a zip file inside a folder, like stage/foobar.zip.
    The SCP plugin will re-create the "stage" folder in the destination. How can I tell it not to? (I've tried specifying the Source like '*/.zip' or 'stage/*.zip' but the result is the same)

  20. Unknown User (javadiver)


    Is it possible to get some information from the pom.xml to create the destination directory (the version number for exemple) instead of having a parameterized buid and asking this information to the user at each beginning of builds ?


  21. Unknown User (naman.patel@gmail.com)

    Can you please add a feature to copy a file to specific location to a specific location. i.e. I have a site where I need a generated XML document to be scp'd. So my source is [workspace]/build/somefolder/somefile.xml that should be copied to [mysite]/foo/somefile.xml and not mysite]/foo//build/somefolder/somefile.xml

  22. Unknown User (jeffdickerson)

    2 wishes:

    • Add a description field to the site definition. There are times that I need to have separate site definitions that point to different directories using different logins/passwords on the same host.
    • Add an exclude option to the "Files to Upload" similar to the ant syntax the plugin follows. (Specifically, I want to exclude all .svn directories from a copy)
  23. Unknown User (anvesh)

    I want to copy only specific files in a directory to remote server.

    I have folder structure /X/Y/...Under Y, I need only the files a b c among a b c d e f. Is this possible...?

    Of course, to copy all files all you need is X/Y/**. But what about copying selectively. I was reading somewhere that this is a kind of bug in the plugin

  24. Unknown User (bedge)

    Can this plugin not be used for publishing promoted artifacts?

    I can't find any mechanism for accessing the PROMOTED_BUILD variable, it's simply not expanded.

    Seems odd that it cannot refer to a promoted build and yet is available as a promotion action. 

  25. Unknown User (jmmcg1)

    scp can recursively copy directories, would it be possible to add this command option?

  26. Unknown User (sur3shbabu)

    I have configured JENKINS in my system (Windows) for my project to pull source code from Stash/Git, build and push it to remote server (Linux). While building through Jenkins, Its pulling source from Stash and building the WAR files and trying to push the war file to Linux server. but while pushing war file to the server, it is asking Kerberos username and password in the server console which requires manually to enter username password. But I want to promote silently in the background. Need your help in configuring the Job.

    Thank you in advance.

  27. Unknown User (kalaivani)

    I am not sure if anyone works on this anymore, looking to see if anyone has the same issue. When the "Execute Windows Batch" step fails, the scp plugin doesn't run - need the artifacts copied while the build fails too.