This should be possible, although it's a bit complicated at the moment. First you need to connect and authenticate through an SshSession
object with a custom AuthenticationRequest
event handler and then you need to bind an Ssh
object to it:
SshSession session = new SshSession();
session.AuthenticationRequest += new SshAuthenticationRequestEventHandler(session_AuthenticationRequest);
session.Connect(serverName, serverPort);
session.Authenticate(userName, password);
Ssh ssh = new Ssh();
ssh.Bind(session);
You can get a sample implementation of AuthenticationRequest
event handle from SftpWinFormClient sample that comes with Rebex SFTP (look for AuthenticationRequestDialog
class).