Windows 10: OpenSSH - how to make scp use certificates from ssh-agent

Discus and support OpenSSH - how to make scp use certificates from ssh-agent in Windows 10 Gaming to solve the problem; Hello. I am using OpenSSH on Windows 11.We are using private key/certificate based authentication not public/private key auth. In Powershell we can use... Discussion in 'Windows 10 Gaming' started by Senyahnoj, Jul 7, 2023.

  1. Senyahnoj Win User

    OpenSSH - how to make scp use certificates from ssh-agent


    Hello. I am using OpenSSH on Windows 11.We are using private key/certificate based authentication not public/private key auth. In Powershell we can use the ssh-add command to add an issued certificate to ssh-agent. For background information we have an issuing authority which gives us short-lived certificates for authentication to our ssh hosts - great article here SSH Security Best Practices using Certificates, 2FA and Bastions goteleport.comOnce added to ssh-agent and entering our passphrase to unlock the private key, we can very simply ssh to a host system usingssh $user@$hostThis i

    :)
     
    Senyahnoj, Jul 7, 2023
    #1

  2. How to : use scp to append public key from linux(client) to windows (server with openssh running) in C:\PROGRAMDATA\ssh\administrators_authorized_keys OR $USERPROFILE:\.ssh\authorized_keys

    I am trying to copy a client key from Linux(Ubuntu) to Windows server as an administrator user.
    so far i am able to achieve this by using following steps(1-4):
    > Note: I am using bash in linux and powershell 7.3.4 in windows as an administrator.
    1. Copy the public key from linux client to windows server:
    `scp ~/.ssh/public_key.pub windowsUser@windowsMachine:__PROGRAMDATA__/ssh/`
    2. ssh into windows server and check if there is `administrators_authorized_keys` file present in `C:\PROGRAMDATA\SSH\`
    If not, Create:
    `New-Item -Force -Path c:\PROGRAMDATA\ssh\administrators_authorized_keys`
    3. Set Permissions for administrators_authorized_keys file:
    `icacls C:\PROGRAMDATA\ssh\administrators_authorized_keys /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"`
    4. Append public_key.pub content into administrator_authorized_keys.
    `Get-Content C:\ProgramData\ssh\public_key.pub | Add-Content C:\ProgramData\ssh\administrators_authorized_keys`

    Now that the `administrators_authorized_keys` file has been created and configured, i am trying to have a different linux client to append its public key to this windows server (with `administrators_authorized_keys` configured) using `scp` in ONE-LINE.
    I have tried something like this:
    `scp Linux2Win_key.pub Admin@WindowsServer:__ProgramData__/ssh/ ; Get-Content C:\ProgramData\ssh\Linux2Win_key.pub | Add-Content C:\ProgramData\ssh\administrators_authorized_keys`
    Public key file is copied but NOT appended to the `administrator_authorized_keys` file. Got an Error:
    `-bash: Add-Content: command not found`
    `-bash: Get-Content: command not found`
    Then i tried this :
    `scp Linux2Win_key.pub Admin@WindowsServer:__ProgramData__/ssh/ ; cat __ProgramData__/ssh/Linux2Win_key.pub >> __ProgramData__/ssh/administrators_authorized_keys`
    Similar result, Public key file is copied but NOT appended to the `administrator_authorized_keys` file. Got an Error:
    `-bash: __ProgramData__/ssh/administrators_authorized_keys: No such file or directory`

    Thoughts:
    It looks like scp can only copy files and ssh-copy-id don't work in windows despite openssh can be enable and ssh can be used in windows.

    If you know any better way (rather than doing manually) to append public key to `authorized_keys` or `administrators_authorized_keys` in windows, please share. Thanks
     
    ZilchBloke, Jul 7, 2023
    #2
  3. How to : use scp to append public key from linux(client) to windows (server with openssh running) in C:\PROGRAMDATA\ssh\administrators_authorized_keys OR $USERPROFILE:\.ssh\authorized_keys

    it seems i was just missing quotes!
    When using scp command, after Admin@WindowsServer:, content must be in quotes.
    scp Linux2Win_key.pub Admin@WindowsServer:'__ProgramData__/ssh/ ; Get-Content C:\ProgramData\ssh\Linux2Win_key.pub | Add-Content C:\ProgramData\ssh\administrators_authorized_keys'
    worked for me. Thanks
     
    ZilchBloke, Jul 7, 2023
    #3
  4. OpenSSH - how to make scp use certificates from ssh-agent

    OpenSSH SSH server from unknown manufacturer

    After I got my PC scanned in safe mode, I had issues with booting in to the normal mode, I had to disable all services and enable them one by one until I came across the “OpenSSH SSH server”, and then I decided to leave “OpenSSH SSH server” disabled, I didn’t want to go through the hassle since it looked like the suspicious service.
     
    GordonXFreeman, Jul 7, 2023
    #4
Thema:

OpenSSH - how to make scp use certificates from ssh-agent

Loading...
  1. OpenSSH - how to make scp use certificates from ssh-agent - Similar Threads - OpenSSH scp certificates

  2. OpenSSH - how to make scp use certificates from ssh-agent

    in Windows 10 Software and Apps
    OpenSSH - how to make scp use certificates from ssh-agent: Hello. I am using OpenSSH on Windows 11.We are using private key/certificate based authentication not public/private key auth. In Powershell we can use the ssh-add command to add an issued certificate to ssh-agent. For background information we have an issuing authority which...
  3. How to : use scp to append public key from linuxclient to windows server with openssh...

    in Windows 10 Gaming
    How to : use scp to append public key from linuxclient to windows server with openssh...: I am trying to copy a client key from LinuxUbuntu to Windows server as an administrator user. so far i am able to achieve this by using following steps1-4: > Note: I am using bash in linux and powershell 7.3.4 in windows as an administrator.1. Copy the public key from linux...
  4. How to : use scp to append public key from linuxclient to windows server with openssh...

    in Windows 10 Software and Apps
    How to : use scp to append public key from linuxclient to windows server with openssh...: I am trying to copy a client key from LinuxUbuntu to Windows server as an administrator user. so far i am able to achieve this by using following steps1-4: > Note: I am using bash in linux and powershell 7.3.4 in windows as an administrator.1. Copy the public key from linux...
  5. How to : use scp to append public key from linuxclient to windows server with openssh...

    in Windows 10 Network and Sharing
    How to : use scp to append public key from linuxclient to windows server with openssh...: I am trying to copy a client key from LinuxUbuntu to Windows server as an administrator user. so far i am able to achieve this by using following steps1-4: > Note: I am using bash in linux and powershell 7.3.4 in windows as an administrator.1. Copy the public key from linux...
  6. how to use openssh

    in Windows 10 Gaming
    how to use openssh: how to use openssh step by step process https://answers.microsoft.com/en-us/windows/forum/all/how-to-use-openssh/c39893b9-20dc-42a9-9a65-486aed388d22
  7. how to use openssh

    in Windows 10 Software and Apps
    how to use openssh: how to use openssh step by step process https://answers.microsoft.com/en-us/windows/forum/all/how-to-use-openssh/c39893b9-20dc-42a9-9a65-486aed388d22
  8. OpenSSH SSH server from unknown manufacturer

    in Windows 10 Gaming
    OpenSSH SSH server from unknown manufacturer: I recently I got hit by Virus:Win32/Neshta.A, I had to disable some services to get my PC running again, I came across a service called "OpenSSH SSH server" from an unknown manufacturer, shlould I leave it disabled and try to get rid of it?...
  9. OpenSSH SSH server from unknown manufacturer

    in Windows 10 Software and Apps
    OpenSSH SSH server from unknown manufacturer: I recently I got hit by Virus:Win32/Neshta.A, I had to disable some services to get my PC running again, I came across a service called "OpenSSH SSH server" from an unknown manufacturer, shlould I leave it disabled and try to get rid of it?...
  10. OpenSSH SSH server from unknown manufacturer

    in Windows 10 Customization
    OpenSSH SSH server from unknown manufacturer: I recently I got hit by Virus:Win32/Neshta.A, I had to disable some services to get my PC running again, I came across a service called "OpenSSH SSH server" from an unknown manufacturer, shlould I leave it disabled and try to get rid of it?...