SSH upload problems encountered when using Hudson

Source: Internet
Author: User

1. connection failure caused by port problems

 
Remote-Prepare: [sshexec] connecting to 123.123.123.123: 22java.net. connectexception: Connection timed out

Solution

Modify build. xml and configure the port number.

 
<Target name = "remote-prepare"> <sshexec host = "$ {web. host} "username =" $ {web. host. user} "Port =" 2014 "Password =" $ {web. host. PWD} "command =" mkdir-p $ {web. host. webroot }/.. /builds "Trust =" true "/> </Target>

2. No permission is displayed

 
Com. jcraft. jsch. jschexception: AUTH fail

Cause: for the sake of security, the server connection uses the key file instead of the user name and password, so you need to replace password with Keyfile.

 
<Target name = "remote-prepare"> <sshexec host = "$ {web. host} "username =" $ {web. host. user} "Port =" 2014 "Keyfile =" $ {web. host. PWD} "command =" mkdir-p $ {web. host. webroot }/.. /builds "Trust =" true "/> </Target>

To modify the port number and Keyfile label, remember to change all the places used to avoid omission.

3. No Password or phrase is provided

 
Neither password nor passphrase for user root has been given. Can't authenticate.

Add passphrase

<Target name = "Upload" depends = "package" Unless = "noup"> <fail unless = "Web. host. webroot "message =" Please specify $ {web. host. webroot }. eg,-dwebroot. dir =/var/www/htdocs/"/> <antcall target =" remote-prepare "/> <echo> uploading build tar file to $ {web. host. webroot }/.. /builds </echo> <echo> This will take a few minutes... </echo> <SCP file = "$ {build. file} "verbose =" true "todir =" $ {web. host. user }@$ {web. host }:$ {web. host. webroot }/.. /builds "passphrase =" "Port =" 2016 "Keyfile =" $ {web. host. PWD} "Trust =" true "/> </Target>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.