From a0ca3792ab11406604ca3e0adeee1509cef0e0fe Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 7 Jul 2022 22:01:14 +0800 Subject: [PATCH] fix identity file --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 7817761..615993f 100644 --- a/index.js +++ b/index.js @@ -12,7 +12,7 @@ async function sleep(ms) { async function execSSH(cmd, desp = "") { core.info(desp); core.info("exec ssh: " + cmd); - await exec.exec("ssh -t -i " + __dirname + "/mac.id_rsa openbsd", [], { input: cmd }); + await exec.exec("ssh -t openbsd", [], { input: cmd }); } @@ -79,6 +79,8 @@ async function setup(nat, mem) { fs.appendFileSync(path.join(process.env["HOME"], "/.ssh/config"), " User root" + "\n"); fs.appendFileSync(path.join(process.env["HOME"], "/.ssh/config"), " HostName localhost" + "\n"); fs.appendFileSync(path.join(process.env["HOME"], "/.ssh/config"), " Port 2224" + "\n"); + fs.appendFileSync(path.join(process.env["HOME"], "/.ssh/config"), " IdentityFile=~/.ssh/mac.id_rsa\n"); + fs.appendFileSync(path.join(process.env["HOME"], "/.ssh/config"), "StrictHostKeyChecking=accept-new\n"); @@ -113,6 +115,8 @@ async function setup(nat, mem) { await exec.exec("chmod 700 " + sshHome); + await io.mv(path.join(workingDir, "/mac.id_rsa"), "/Users/runner/.ssh/mac.id_rsa"); + let vmName = "openbsd";