Results 1 to 1 of 1
  1. #1
    merc is offline Member
    Join Date
    Jan 2010
    Posts
    1
    Rep Power
    0

    Default J2SSH & file 'known_hosts'

    Hi
    I have created a Java program that transfers a file to a remote server via ssh. For that I use the jar file 'j2ssh-core-0.2.9'.
    This Java program is runned by an ANT-script from a linux server.
    I would like not to confirm every time that I allow the host key: Do you want to allow this host key? [Yes|No]: Always option disabled, host file is not writeable

    It seems the public key of the remote can't be written on the client server...

    1) Should a 'known_hosts' file be present in the /etc/ssh/ dir? (There is no such file present in the client server where I run the ANT-script)
    2) I get the following warning: WARN com.sshtools.j2ssh.transport.HostKeyVerification - Not enough permission to load a hosts file, so just creating an empty list

    Here is the log (some info have been masked) I get after running the ANT-script and precisely just after the java code:
    SshClient ssh =new SshClient();
    ssh.connect(strHost);



    **********
    * LOG *
    **********
    [java] [main] WARN com.sshtools.j2ssh.transport.HostKeyVerification - Not enough permission to load a hosts file, so just creating an empty list
    [java] [main] INFO com.sshtools.j2ssh.transport.cipher.SshCipherFacto ry - Loading supported cipher algorithms
    [java] [main] INFO com.sshtools.j2ssh.transport.kex.SshKeyExchangeFac tory - Loading key exchange methods
    [java] [main] INFO com.sshtools.j2ssh.configuration.ConfigurationLoad er - JAVA version is 1.6.0_11
    [java] [main] INFO com.sshtools.j2ssh.configuration.ConfigurationLoad er - Extension /usr/java/jdk1.6.0_11/jre/lib/ext/dnsns.jar being added to classpath
    [java] [main] INFO com.sshtools.j2ssh.util.ExtensionClassLoader - Adding /usr/java/jdk1.6.0_11/jre/lib/ext/dnsns.jar to the extension classpath
    [java] [main] INFO com.sshtools.j2ssh.configuration.ConfigurationLoad er - Extension /usr/java/jdk1.6.0_11/jre/lib/ext/sunpkcs11.jar being added to classpath
    [java] [main] INFO com.sshtools.j2ssh.util.ExtensionClassLoader - Adding /usr/java/jdk1.6.0_11/jre/lib/ext/sunpkcs11.jar to the extension classpath
    [java] [main] INFO com.sshtools.j2ssh.configuration.ConfigurationLoad er - Extension /usr/java/jdk1.6.0_11/jre/lib/ext/sunjce_provider.jar being added to classpath
    [java] [main] INFO com.sshtools.j2ssh.util.ExtensionClassLoader - Adding /usr/java/jdk1.6.0_11/jre/lib/ext/sunjce_provider.jar to the extension classpath
    [java] [main] INFO com.sshtools.j2ssh.configuration.ConfigurationLoad er - Extension /usr/java/jdk1.6.0_11/jre/lib/ext/localedata.jar being added to classpath
    [java] [main] INFO com.sshtools.j2ssh.util.ExtensionClassLoader - Adding /usr/java/jdk1.6.0_11/jre/lib/ext/localedata.jar to the extension classpath
    [java] [main] INFO com.sshtools.j2ssh.transport.publickey.SshKeyPairF actory - Loading public key algorithms
    [java] [main] INFO com.sshtools.j2ssh.transport.compression.SshCompre ssionFactory - Loading compression methods
    [java] [main] INFO com.sshtools.j2ssh.transport.hmac.SshHmacFactory - Loading message authentication methods
    [java] [main] INFO com.sshtools.j2ssh.transport.TransportProtocolComm on - Starting transport protocol
    [java] [Transport protocol 1] INFO com.sshtools.j2ssh.transport.TransportProtocolComm on - Registering transport protocol messages with inputstream
    [java] [Transport protocol 1] INFO com.sshtools.j2ssh.transport.TransportProtocolComm on - Negotiating protocol version
    [java] [Transport protocol 1] INFO com.sshtools.j2ssh.transport.TransportProtocolComm on - Protocol negotiation complete
    [java] [Transport protocol 1] INFO com.sshtools.j2ssh.transport.TransportProtocolComm on - Starting key exchange
    [java] [Transport protocol 1] INFO com.sshtools.j2ssh.transport.kex.DhGroup1Sha1 - Starting client side key exchange.
    [java] [Transport protocol 1] INFO com.sshtools.j2ssh.transport.HostKeyVerification - Verifying xx.xx.xx.xx host key
    [java] The host xx.xxx.xx.xxxx.com,11.111.11.11 is currently unknown to the system
    [java] The host key fingerprint is: 9999: 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99
    [java] Always option disabled, host file is not writeable
    Last edited by merc; 01-19-2010 at 11:51 AM.

Similar Threads

  1. j2ssh to run multiple commands
    By idan hen in forum Networking
    Replies: 4
    Last Post: 10-18-2009, 08:21 PM
  2. retain value of input type file in a jsp file while being dynamically generated
    By nidhi c in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-27-2009, 02:21 AM
  3. Replies: 0
    Last Post: 02-11-2009, 09:53 AM
  4. Replies: 7
    Last Post: 05-23-2008, 03:46 AM
  5. J2ssh 0.2.9
    By levent in forum Java Software
    Replies: 0
    Last Post: 05-23-2007, 07:46 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •