Client
authentication can be either by password, by public/private keys, or by
keyboard-interactive authentication.
Password
authentication is generally the easiest to try first, although some
SFTP servers are
set up to disallow password authentication,
in which case
the connection attempt will fail unless password authentication is
enabled in the server
configuration file.To use password
authentication, call the setAuthentication
method before calling connect, supplying the username and password:
The user name
and password should be that of
the SSH user that the client is logging in as.
Note
that some SFTP servers are set up to disallow password authentication,
in which case
the connection attempt will fail unless password authentication is
enabled in the server
configuration file.