• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Connection is closed by foreign host given by Ant SCP task  RSS feed

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using scp task in my ant build file and target as follows:

<target name="copyFileToRemote">
<scp file="sample.dll" todir="user@host:/shared" port="21" trust="true" password="password" verbose="true"/>
</target>


When i call the "copyFileToRemote" target ,It is giving following error:

[scp] Connecting to host:21
java.lang.Exception: com.jcraft.jsch.JSchException: connection is closed by foreign host


I have tried both ports 21 and 22 also. The remote machine having ftp server and it up and running with read/write permissions.
Could you please guide me to resolve this problem.

Regards,
Sasank
 
author
Bartender
Posts: 3280
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SCP != FTP, it needs to have scp enabled.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!