Ant에서 jsch 라이브러리를 이용하여 scp 또는 sshexec 명령어 실행할 때 reject Hostkey 에러를 만난 경우 해결 방법




Ant에서 ssh, scp 등을 이용할 때 근래들어 jsch 라이브러를 이용하였습니다. 
초창기에 아래와 같은 에러들을 만나고는 합니다.

com.jcraft.jsch.JSchException: reject HostKey

해결 방법은 ant task 옵션에 아래와 같이 truest="true" 값을 추가하면 해결 됩니다.

<scp todir="${ssh.userid}:${ssh.password}@${ssh.server}:${RBMS.dir}" trust="true">

에러가 나는 경우는 아래와 같습니다.

<scp todir="${ssh.userid}:${ssh.password}@${ssh.server}:${RBMS.dir}" > 
 
 

댓글

Designed by JB FACTORY