No access to SYSTEMS's .ssh store (Windows)
Hi guys,
I am in the process of switching from Windows built-in
Since the script will later run under the
The first problem with this is that WinSCP cannot use this key because it only supports ppk.
The second problem is that when I try to convert this key via a PowerShell running as
The same does work without any problems if I don't use that folder:
What I am doing wrong here?
I am in the process of switching from Windows built-in
ssh
/scp
to WinSCP in my PowerShell script to make the transfer more reliable, but I have a little problem here.
Since the script will later run under the
NT AUTHORITY\SYSTEM
, I create an SSH key in its .ssh
folder (C:\WINDOWS\system32\config\systemprofile\.ssh\
) to make the key a bit more secure.
The first problem with this is that WinSCP cannot use this key because it only supports ppk.
The second problem is that when I try to convert this key via a PowerShell running as
SYSTEM
, it seems that WinSCP itself is not running as SYSTEM
and cannot access this folder:
PS C:\WINDOWS\system32\config\systemprofile\.ssh> whoami nt authority\system
PS C:\WINDOWS\system32\config\systemprofile\.ssh> ls Directory: C:\WINDOWS\system32\config\systemprofile\.ssh Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 6/28/2023 4:13 PM 444 id_ed25519 -a---- 6/28/2023 4:13 PM 124 id_ed25519.pub -a---- 6/28/2023 4:14 PM 203 known_hosts
PS C:\WINDOWS\system32\config\systemprofile\.ssh> &"C:\temp\winscp.exe" /keygen .\id_ed25519 /output=.\id_ed25519.ppk
Private key file '.\id_ed25519' does not exist or cannot be opened. System Error. Code: 2. The system cannot find the file specified
PS C:\temp\test> &"C:\temp\winscp.exe" /keygen .\id_ed25519 /output=.\id_ed25519.ppk
Key saved to ".\id_ed25519.ppk".