imagej / imagej-plugins-uploader-ssh

Core ImageJ uploader plugin: SSH
Other
1 stars 1 forks source link

Fall back to credentials when ssh keys fail on sftp upload #3

Open imagejan opened 3 years ago

imagejan commented 3 years ago

When trying to upload to our private ftp update site from an up-to-date Fiji installation (on Windows), I now get the following exception:

[ERROR] com.jcraft.jsch.JSchException: invalid privatekey: [B@5584d17
    at com.jcraft.jsch.KeyPair.load(KeyPair.java:664)
    at com.jcraft.jsch.KeyPair.load(KeyPair.java:561)
    at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:40)
    at com.jcraft.jsch.JSch.addIdentity(JSch.java:406)
    at com.jcraft.jsch.JSch.addIdentity(JSch.java:366)
    at net.imagej.plugins.uploaders.ssh.SSHSessionCreator.connect(SSHSessionCreator.java:80)
    at net.imagej.plugins.uploaders.ssh.SSHSessionCreator.getSession(SSHSessionCreator.java:251)
    at net.imagej.plugins.uploaders.ssh.SSHFileUploader.login(SSHFileUploader.java:81)
    at net.imagej.updater.FilesUploader.login(FilesUploader.java:410)
    at net.imagej.ui.swing.updater.UpdaterFrame.upload(UpdaterFrame.java:801)
    at net.imagej.ui.swing.updater.UpdaterFrame$5$1.run(UpdaterFrame.java:309)
imagejan commented 3 years ago

It turns out that there where keypairs in ~/.shh that got in the way of password authentication. Moving the .ssh folder temporarily out of the way solved the issue, although Fiji wanted to recreate the directory to add an entry to known-hosts then. See also the discussion on gitter.