java - not able to authenticate a com.trilead.ssh2.Connection -


heyy!

i using com.trilead.ssh2.connection in java 7 open connection.

when testing opening connection localhost on port 22:

connection connection = new connection("localhost", 22);

then trying authenticate authenticatewithpublickey method:

char[] key = ioutils.tostring(new fileinputstream("keylocation")).tochararray(); boolean authenticated = connection.authenticatewithpublickey("myusername", key, ""); 

but not authenticating. running on mac sierra, i'm wondering if has do. using dsa pair of keys.

thanks!!

i not have work around dsa pair of keys (i believe has key size, , dsa 1024). created new rsa pair of keys 2048 size. information i'll write steps managing authenticate connection java code configured mac sierra:

i in .ssh/ directory:

ssh-keygen -t rsa -f 'key_name' cat key_name.pub                # copy public key # add public key authorized_keys file ssh-add -k key_name ssh-add -a ssh-add -l                      # check if key added 

and thats it, managed authenticate connection.


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -