fix: now ssh connection use use private key instead of the default

This commit is contained in:
Levi Yan
2024-10-28 19:02:56 +08:00
parent b279860ebe
commit d79a4a8243
2 changed files with 8 additions and 2 deletions

View File

@@ -6,8 +6,14 @@ import * as rd from 'readline'
const { NodeSSH } = require('node-ssh')
import * as utils from './utils';
import User from './user';
export default class RemoteContainer {
private user:User;
constructor(user:User) {
this.user = user
}
async firstConnect(host: string, username: string, port: number): Promise<string>; // connect with key
// deprecated
@@ -29,7 +35,7 @@ export default class RemoteContainer {
host: host,
username: username,
port: port,
privateKey: utils.getDefaultPrivateKey()
privateKeyPath: this.user.getUserPrivateKeyPath()
});
progress.report({ message: "连接成功,开始安装" });