Skip to content

SSH Private Key password does not work / not supported #22

@Magmaruss

Description

@Magmaruss

I tried to connect to my VM using nanoCloud, but there is no possibility to set private-key-password. When I tried to set KEY_PASSWORD, there was no result. I see, that You use JSch inside project to connect with VM's and I tried to connect with clean JSch library and all is good, but in nanoCloud there is no possibility to set this JSch property. The JSch identity is added in SimpleSshSessionProvider in line:
jsch.addIdentity(path)

I need one small fix to have possibility to set second argument of addIdentity method - "password" like this:
jsch.addIdentity(path, sshPassword)

Below I paste the example of working key auth by JSch (maybe will be useful/helpful):

JSch jsch = new JSch();
jsch.addIdentity("path", "password");
Session session = jsch.getSession("user", "0.0.0.0", 22);
session.setConfig("PreferredAuthentications", "publickey,keyboard-interactive,password");
session.setConfig("StrictHostKeyChecking", "no");
session.connect();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions