Re: [JSch-users] JSch configuration
Status: Alpha
Brought to you by:
ymnk
From: COHEN, S. M (ATTSI) <sc...@at...> - 2009-05-22 15:04:16
|
I see, you don't use the UI. Interesting. I, instead, created my own implementation of UserInfo, but then I had to make the promptPassword method return true and of course, the getPassword member return the password. This worked as well but yours is so much simpler. Thanks. _____ From: Macias, Horaci (Horaci) [mailto:hm...@av...] Sent: Friday, May 22, 2009 9:59 AM To: COHEN, STEVEN M (ATTSI); jsc...@li... Subject: RE: [JSch-users] JSch configuration lol, it looks like you're facing the same issues I had a couple of days ago. Try the following: session = jsch.getSession(user, host, port); session.setPassword(password); session.setConfig("StrictHostKeyChecking", "no"); and make sure you remove/comment the session.setUserInfo(ui); I started with the Shell example but it looks like the sftp is quite close to that too. hope this helps, Horaci _____ From: COHEN, STEVEN M (ATTSI) [mailto:sc...@at...] Sent: viernes, 22 de mayo de 2009 16:56 To: Macias, Horaci (Horaci); jsc...@li... Subject: RE: [JSch-users] JSch configuration Thanks. Yeah, I set it to "off" and that seemed to work, only leading me to the next roadblock. When using the sftp.java sample that is included I was able to connect to my host without any difficulty. Host uses simple password authentication, no keys. I'm now writing a non-interactive client that just connects and I'm getting an Auth cancel exception. I am supplying the correct username and password. What other configs do I need to change to achieve the connection? _____ From: Macias, Horaci (Horaci) [mailto:hm...@av...] Sent: Friday, May 22, 2009 9:47 AM To: COHEN, STEVEN M (ATTSI); jsc...@li... Subject: RE: [JSch-users] JSch configuration Hi Steve, I'm by no means a JSch expert but I had a similar request and I just solved it by using session.setConfig("StrictHostKeyChecking", "no"); before your session.connect(). This seems to work for me. hope this helps, Horaci _____ From: COHEN, STEVEN M (ATTSI) [mailto:sc...@at...] Sent: viernes, 22 de mayo de 2009 16:35 To: jsc...@li... Subject: [JSch-users] JSch configuration Looking at the source code, it appears that the JSch configuration is a simple Hashtable with a large number of keys defined. I don't find any documentation listing what may be acceptable values for those keys. In particular I am interesting in turning off the StrictHostKeyChecking, which is by default given a value of "ask". My application wants to simply accept the key of the (only) sftp host it will be connecting to without any user interaction needed. How may this be implemented most easily? |