I'm trying out the SFPT Public Key Authentication Client. The client works fine, but for some reason it seems to be failing on changing directories. The SFTP password client works fine for changing directories.
Here is my code snippet
File privateKey = new File("/opt/local/pegasus/.ssh/id_rsa");
SftpSubsystemClient sftp = null;
SshConnectionProperties properties = new SshConnectionProperties();
SshClient ssh = new SshClient();
ssh.connect(properties, new IgnoreHostKeyVerification());
PublicKeyAuthenticationClient pk = new PublicKeyAuthenticationClient();
SshPrivateKeyFile file = SshPrivateKeyFile.parse(privateKey);
SshPrivateKey key = file.toPrivateKey(ftpPassword);
int result = ssh.authenticate(pk);
SftpClient sftpClient = ssh.openSftpClient();
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.