Skip to content

Commit bfafdb4

Browse files
karibouLouis Bouchardbene2k1
authored
feat(instances): Fix error message in scw-fetch-ssh-keys in windows i… (#4376)
* feat(instances): Fix error message in scw-fetch-ssh-keys in windows images * Apply suggestions from code review --------- Co-authored-by: Louis Bouchard <[email protected]> Co-authored-by: Benedikt Rollik <[email protected]>
1 parent f110780 commit bfafdb4

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
meta:
3+
title: Fix error when fetching SSH keys on Windows Server 2022
4+
description: This page guides you through resolving the error that occurs when fetching SSH keys on Windows Server 2022.
5+
content:
6+
h1: Fix error when fetching SSH keys on Windows Server 2022
7+
paragraph: This page guides you through resolving the error that occurs when fetching SSH keys on Windows Server 2022.
8+
tags: windows server 2022 ssh-key
9+
dates:
10+
validation: 2025-02-06
11+
posted: 2023-02-06
12+
categories:
13+
- compute
14+
---
15+
16+
After enabling the OpenSSH server on Windows Server 2022 and Windows Server 2022 Core instances you will
17+
need to fetch the SSH keys of your project using `Scw-Fetch-SSH-Keys`. When you run this command for the first time, the following error message will be displayed:
18+
19+
```
20+
PS C:\Users\Administrator> Scw-Fetch-SSH-Keys
21+
Remove-Item : Cannot find path 'C:\ProgramData\ssh\administrators_authorized_keys' because it does not exist.
22+
At C:\Program Files\WindowsPowerShell\Modules\ScalewayEcosystem\0.0.10.3\ScalewayEcosystem.psm1:54 char:2
23+
+ Remove-Item $authorized_keys
24+
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25+
+ CategoryInfo : ObjectNotFound: (C:\ProgramData\...authorized_keys:String) [Remove-Item], ItemNotFoundEx
26+
ception
27+
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
28+
29+
processed file: c:\ProgramData\ssh\administrators_authorized_keys
30+
Successfully processed 1 files; Failed processing 0 files
31+
```
32+
The SSH keys will still be fetched, but this message may reappear in the file.
33+
```.
34+
C:\ProgramData\ssh\administrators_authorized_keys if deleted.
35+
36+
To avoid this message, simply update the `ScalewayEcosystem` package using the folllowing
37+
commands:
38+
```
39+
Register-PSRepository -Name NuGet -SourceLocation https://api.nuget.org/v3/index.json -PublishLocation https://api.nuget.org/v3/index.json -InstallationPolicy Trusted
40+
Update-Module ScalewayEcosystem
41+
Remove-Module ScalewayEcosystem
42+
Import-Module ScalewayEcosystem
43+
```
44+

0 commit comments

Comments
 (0)