Hi,
I had the same question friday, and if you look at the top of the
ClientSession class :
void addPasswordIdentity(String password);
void addPublicKeyIdentity(KeyPair key);
AuthFuture auth() throws IOException;
So you just have to set a password or a key and authenticate :
ClientSession session = client.connect("myUser", "127.0.0.1",
22).await().getSession();
session.addPublicKeyIdentity(myKey);
assertTrue(session.auth().await().isSuccess());
Guillaume Lecroc
2014-05-16 10:42 GMT+02:00 Piotr Gora <[email protected]>:
> Hi
>
> We are using the Apache SSDH libs since 0.9.0 and saw now that the 0.11.0
> had authPassword as well as many of the connect API calls set as
> deprecated, but there is no information on what to use instead. The API
> javadocs is for 0.9.0 and even in the code there is no guideline as to what
> to use to send in a password when connecting. The "how to" in SshClient
> class describes the connect method using deprecated calls.
>
> Best Regards
> Piotr Gora
>
>
> PIOTR GORA
> DEVELOPER
> PHONE: +46 703 20 13 58
> E-MAIL: [email protected]<mailto:
> [email protected]>
>
> WIRELESS MAINGATE NORDIC AB
> ADDRESS: BOX 244, SE-371 24 KARLSKRONA, SWEDEN
> VISITORS: DROTTNINGGATAN 16
> PHONE: +46 455 36 37 00, FAX: +46 455 36 37 37
> WEB: WWW.MAINGATESOLUTIONS.COM<http://www.maingatesolutions.com/>
>
>
>
> NOTICE - This message and any attached files may contain information that
> is confidential and/or subject of legal privilege intended only for use by
> the intended recipient. If you are not the intended recipient or the person
> responsible for delivering the message to the intended recipient, be
> advised that you have received this message in error and that any
> dissemination, copying or use of this message or attachment is strictly
> forbidden, as is the disclosure of the information therein. If you have
> received this message in error please notify the sender immediately and
> delete the message.
>
--
Guillaume