修改ssh连接时用户为root

This commit is contained in:
2025-11-03 14:04:59 +08:00
parent 7367d3cf37
commit ece4943d2a

View File

@@ -169,7 +169,7 @@ export default class RemoteContainer {
// connect with key // connect with key
await ssh.connect({ await ssh.connect({
host: hostname, host: hostname,
username: username, username: 'root',
port: port, port: port,
privateKeyPath: this.user.getUserPrivateKeyPath(), privateKeyPath: this.user.getUserPrivateKeyPath(),
readyTimeout: 30000, // 增加超时时间到30秒 readyTimeout: 30000, // 增加超时时间到30秒
@@ -236,7 +236,7 @@ export default class RemoteContainer {
// only connect successfully then save the host info // only connect successfully then save the host info
console.log(`[RemoteContainer] Storing project SSH info`); console.log(`[RemoteContainer] Storing project SSH info`);
await this.storeProjectSSHInfo(host, hostname, port, username) await this.storeProjectSSHInfo(host, hostname, port, 'root')
resolve('success') resolve('success')
} catch (error) { } catch (error) {