fix: now ssh connection use use private key instead of the default
This commit is contained in:
@@ -12,8 +12,8 @@ export default class DSHome {
|
||||
|
||||
constructor(context: vscode.ExtensionContext) {
|
||||
this.context = context;
|
||||
this.remoteContainer = new RemoteContainer();
|
||||
this.user = new User(context);
|
||||
this.remoteContainer = new RemoteContainer(this.user);
|
||||
}
|
||||
|
||||
async toggle(url: string = DSHome.defaultUrl) {
|
||||
|
@@ -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: "连接成功,开始安装" });
|
||||
|
||||
|
Reference in New Issue
Block a user