Skip to content

Commit bafe7bb

Browse files
committed
FIX: Updated ssh key path and IdentityFile entry
- use $HOME in actual path to $sshkey but rely on "~" in IdentityFile entry of ~/.ssh/config - adapted tests accordingly On branch main Changes to be committed: modified: client/setup.ps1 modified: tests/test.ps1
1 parent c763319 commit bafe7bb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

client/setup.ps1

+5-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ param(
1717
)
1818

1919
# Default ssh config/key location
20-
$sshdir = "$HOME\.ssh"
20+
$sshdirname = ".ssh"
21+
$sshkeyname = "vscode-remote-hpc"
22+
$sshdir = "$HOME\$sshdirname"
2123
$sshconfig = "$sshdir\config"
2224
$sshconfigbak = "${sshconfig}_$(get-date -f yyyy-MM-dd).vsr"
23-
$sshkey = "$sshdir\vscode-remote-hpc"
25+
$sshkey = "$sshdir\$sshkeyname"
2426

2527
Write-Output "--- This script sets up VS Code remote connections to the HPC cluster ---"
2628

@@ -99,7 +101,7 @@ if (-not $headnode) {
99101
$configblock = @"
100102
Host vscode-remote-hpc
101103
User $uname
102-
IdentityFile $sshkey
104+
IdentityFile ~/$sshdirname/$sshkeyname
103105
ProxyCommand ssh $uname@$headnode ""/usr/local/bin/vscode-remote connect""
104106
StrictHostKeyChecking no
105107
"@

tests/test.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ $dummykey = "$sshdir\dummy"
2727
$expectedconfig = @"
2828
Host vscode-remote-hpc
2929
User $VSRtester
30-
IdentityFile $sshkey
30+
IdentityFile ~/.ssh/vscode-remote-hpc
3131
ProxyCommand ssh $VSRtester@$VSRhead ""/usr/local/bin/vscode-remote connect""
3232
StrictHostKeyChecking no
3333
"@.Trim()

0 commit comments

Comments
 (0)