Skip to main content

We are trying to create the knowhosts file required for SFTP communications between IFS and Pagero (our EDI vendor).  From IFS documentation, here is what we are supposed to do:

 

SFTP requires a "known hosts" file. The known hosts file contains the public key of the SSH2 server,
and the purpose of this file is to ensure that a server cannot maliciously impersonate another server
(e.g. man-in-the-middle attacks).
The known hosts file may already have been created by an SSH2 client and may be reused by an SFTP
reader. If there is no known hosts file or it is in an incompatible file format, a new known hosts file can
be created with the following command:
java -cp <IFS_HOME>\javaruntime\ifs-connector-sftp.jar;<IFS_HOME>\javaruntime\jsch-0.1.50.jar
ifs.fnd.connectserver.sftp.SftpCreateFiles -CreateKnownHosts=KNOWNHOSTS -
hostname=SFTPHOST -username=USERNAME -password=PASSWORD

 

I trying executing the command on our IFS application server and get errors, A JNI error has occurred…see below

I do not know JAVA very well, does anyone know what can be done to get this script working?

 

 

It could be most probably due to the version of jsch jar. Check <IFS_HOME>\javaruntime folder whether you have a never version of this (jsch-0.1.53.jar) and if it’s present, change the command to use it.

java -cp <IFS_HOME>\javaruntime\ifs-connector-sftp.jar;<IFS_HOME>\javaruntime\jsch-0.1.53.jar
ifs.fnd.connectserver.sftp.SftpCreateFiles -CreateKnownHosts=KNOWNHOSTS -
hostname=SFTPHOST -username=USERNAME -password=PASSWORD

 

Hope it helps!

Damith


I tried the recommended change because the file does exist (jsch-0.1.53.jar) but now ran into a different error. 

When checking my <IFS_HOME>\javaruntime folder, I seem to be missing the following .jar file (ifs.fnd.connectserver.sftp.SftpCreateFiles).  

Could that be the issue?  

Thanks, Mark


Hi Mark, ifs.fnd.connectserver.sftp.SftpCreateFiles is packed in ifs-connector-sftp.jar, so it should be available. Can you post the new error? may be the error stack says more ;)

 


This is the error I get now:

 


​​​

Any ideas what to try next?


There are two things I guess could wrong

  1. knownhosts file is not created.

run below command in cmd first and then run the command to create knownhost

fsutil file createnew E:\ifs\ifstest\knownhosts 0

 

  1. password contains & sign so cmd treat as two commands. Strongly suggest to change the password since this forum is public and make sure not to include & in the new password ;)

 

Cheers!

Damith


There are two things I guess could wrong

  1. knownhosts file is not created.

run below command in cmd first and then run the command to create knownhost

fsutil file createnew E:\ifs\ifstest\knownhosts 0

 

  1. password contains & sign so cmd treat as two commands. Strongly suggest to change the password since this forum is public and make sure not to include & in the new password ;)

 

Cheers!

Damith

Hi @dsj (Damith)!

 

Long time no see! On your point #2, you can escape ampersands (&) using the caret (^) character in DOS (command prompt on Windows.) Just put the caret right before the & in the password and the knownhosts files should be generatable.

 

Regards,

Randy


Hello

@dsj 

@EntRandyG 

@svrmhuebner 

 

I read the entire post I was wondering if the issue was resolved ? 

 

Thanks,

JL


Reply