Hello all,

 

I'm trying to use jsch in order to connect from windows machine to some
remote host running sshd on CentOS. When working with user/password
credentials everything is running just fine, but if I try to configure jsch
with my keys, then Session.connect() hangs. Taking thread dump shows:

 

SocketInputStream.socketRead0(FileDescriptor, byte[], int, int, int) line:
not available [native method] [local variables unavailable]       

SocketInputStream.read(byte[], int, int) line: 129             

IO.getByte(byte[], int, int) line: 82           

Session.read(Buffer) line: 809    

UserAuthPublicKey.start(Session) line: 83            

Session.connect(int) line: 419     

Session.connect() line: 150          

SshClient.main(String[]) line: 57                

 

And here is the relevant code snippet:

 

JSch jsch = new JSch();

 

jsch.addIdentity( "C:/Documents and Settings/baraky/Application
Data/SSHTEST/id_rsa" );

 

Session sshSession = jsch.getSession( "read-user", "host721", 22 );

 

sshSession.setTimeout( 1000000 );

 

Hashtable<String, String> config = new Hashtable<String, String>();

 

config.put( "StrictHostKeyChecking", "no" );

config.put("PreferredAuthentications", "publickey");

 

sshSession.setConfig( config );

 

sshSession.connect();

 

Using Putty to connect the host with these keys works as expected.

 

Can someone direct me what am I doing wrong?

 

Thanks,

 

Barak.

------------------------------------------------------------------------------
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to