j2ssh and known_hosts

T

theoryboy

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
 
C

Chris Head

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

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-----
 
P

Peter Saffrey

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top