j2ssh and known_hosts

Discussion in 'Java' started by theoryboy@my-deja.com, Aug 9, 2005.

  1. Guest

    I'm writing a Java application that includes uploading a number of
    files using scp. I am using the j2ssh library for this. For the most
    part, it works fine but the validation of known hosts seems to be
    faulty.

    If I ssh to the host in question from a regular shell, it connects
    without comment using the key pairs found in $HOME/.ssh. Using j2ssh,
    however, I get (amongst the other output)

    The host <host name and IP address deleted> is currently unknown to the
    system
    The host key fingerprint is: 1024: cc d0 4a 39 a7 d7 f1 6b f2 b2 55 a7
    f0 8c 54 56
    Always option disabled, host file is not writeable

    (It reports the hostname and IP address properly in the <> bit)

    I've started to look at the source code to look at what might be
    causing this, but I was hoping somebody had seen it before and could
    help me out.

    Any thoughts?

    Thanks,

    Peter
    , Aug 9, 2005
    #1
    1. Advertising

  2. Chris Head Guest

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    wrote:
    [snip]
    > The host <host name and IP address deleted> is currently unknown to the
    > system
    > The host key fingerprint is: 1024: cc d0 4a 39 a7 d7 f1 6b f2 b2 55 a7
    > f0 8c 54 56
    > Always option disabled, host file is not writeable
    >
    > (It reports the hostname and IP address properly in the <> bit)
    >
    > I've started to look at the source code to look at what might be
    > causing this, but I was hoping somebody had seen it before and could
    > help me out.

    [snip]

    Hi,
    I don't know J2SSH as such, but I suspect it may be the same library
    that's used in jEdit's FTP plugin. If this is the case, then the library
    maintains its own separate list of known hosts, which is not the same as
    your OpenSSH list. This allows it to operate on platforms where OpenSSH
    is not installed (Windows, for example, will not have a .ssh directory
    anywhere).

    I don't know about the "host file not writable" thing; I suspect you may
    need to create a directory somewhere which J2SSH wants to write the
    hosts file into.

    Chris
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.1 (MingW32)

    iD8DBQFC+aMu6ZGQ8LKA8nwRAswBAJ0b/GO6WWj6qvKuD0B3p88CnuKIxgCgsBR5
    U/jsmLA3J2QDgQDoRpV1jco=
    =Ur+D
    -----END PGP SIGNATURE-----
    Chris Head, Aug 10, 2005
    #2
    1. Advertising

  3. Thanks for your reply Chris. In fact, j2ssh was looking for
    $HOME/.ssh/known_hosts, but could not understand its format. This was
    mentioned in one of the log messages, which I had not examined
    carefully enough. I trimmed out some of the more exotic looking entries
    in known_hosts and it worked fine.

    Cheers,

    Peter
    Peter Saffrey, Aug 17, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nut Cracker
    Replies:
    1
    Views:
    333
  2. jakk
    Replies:
    4
    Views:
    12,057
  3. Geir
    Replies:
    0
    Views:
    781
  4. Marcelo

    J2SSh

    Marcelo, Oct 4, 2005, in forum: Java
    Replies:
    2
    Views:
    1,760
    Chris Smith
    Oct 5, 2005
  5. titi

    if and and vs if and,and

    titi, Mar 9, 2007, in forum: VHDL
    Replies:
    4
    Views:
    571
    Mike Treseler
    Mar 11, 2007
Loading...

Share This Page