Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6040615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:32:24+00:00 2026-05-23T06:32:24+00:00

I have one requirement: copy local files to remote system. I have done the

  • 0

I have one requirement: copy local files to remote system.
I have done the following:

  1. downloaded jsch-0.1.44.jar and copied to lib folder of Ant
  2. set the path and every thing

My buildfile is:

<project name="ImportedBuild" default="all">
  <target name="copyFileToRemote">
    <echo>2222222222 copyFileToRemote Examples:::::::::::::</echo>
    <scp file="sample.txt" todir="${username}:${password}@${hostname}:/shared"/>
  </target>
</project>

When I run Ant, I get this error:

BUILD FAILED com.jcraft.jsch.JSchException: reject HostKey: 10.184.74.168
    at com.jcraft.jsch.Session.checkHost(Session.java:712)
    at com.jcraft.jsch.Session.connect(Session.java:313)
    at com.jcraft.jsch.Session.connect(Session.java:154)
    at org.apache.tools.ant.taskdefs.optional.ssh.SSHBase.openSession(SSHBase.java:212)
    at org.apache.tools.ant.taskdefs.optional.ssh.Scp.upload(Scp.java:291)
    at org.apache.tools.ant.taskdefs.optional.ssh.Scp.execute(Scp.java:203)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    ... etc ...

Any ideas how to resolve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:32:25+00:00Added an answer on May 23, 2026 at 6:32 am

    According to the Ant scp task docs, trust attribute:

    This trusts all unknown hosts if set
    to yes/true. Note If you set this to
    false (the default), the host you
    connect to must be listed in your
    knownhosts file, this also implies
    that the file exists.

    The trust attribute is not used in your task call, so it appears that the host (10.184.74.168) is not in your knownhosts file. Suggest you add trust="true", or add the host to the knownhosts file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My requirement is to connect to a remote computer, copy files with the extension
I have one requirement in C. char abc[]=hello; char hello[]=world; Using abc whether we
I have one requirement that i have to place the log file in the
I am developing native iPhone app. I have one requirement that, there are 5
I have one intresting requirement to achieve. could you please help? Please find the
I have one portal with 3 modules inside it, now my requirement is i
i have one database, and it contains some columns. My requirement is that how
I have a winform application which contains a window resizable but one requirement is
I have a requirement where I have to drop one row from a table
We have trouble implementing a nice session mechanism in JSP. One of our requirement

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.