Windows 10: Windows not accepting key for SSH key-based authentication?

Discus and support Windows not accepting key for SSH key-based authentication? in Windows 10 Ask Insider to solve the problem; I'm trying to use key-based authentication to SSH into my Windows machine (running Windows 10 Pro, Insider build 21337.1000) from a MacBook Air running... Discussion in 'Windows 10 Ask Insider' started by /u/FloatingMilkshake, Mar 18, 2021.

  1. Windows not accepting key for SSH key-based authentication?


    I'm trying to use key-based authentication to SSH into my Windows machine (running Windows 10 Pro, Insider build 21337.1000) from a MacBook Air running macOS 10.15.7 Catalina. Password-based auth works fine but whenever I try key-based auth it just...doesn't work. It falls back to my password every time. I've added my Mac's public key to ~/.ssh/authorized_keys and even tried adding it to C:\ProgramData\ssh\administrators_authorized_keys because my Windows user account has administrator permissions...but that didn't work. I also tried commenting these two lines out in my sshd_config file:

    Match Group administrators AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys

    ...but that didn't work either. If I use the same file to restrict the PC to key-based auth and then try to SSH in from the Mac (with its key added to both authorized_keys files) I get an access denied error (because I didn't provide a matching key and password auth is disabled).

    I'm not sure what else to try. I restarted the sshd service between each of those changes to ensure they took effect properly...yet nothing worked. I also tried using the Termius app on my iPhone (SSH client) to generate a key and export it to this PC using SSH password-based auth (don't worry, I turned password-based auth back on before trying this) and got an "export failed" error. No further details.

    It can't be something I'm doing. I did this exact process to set up key-based auth on an Ubuntu host and it worked fine. So I'm not sure if there's just something in Windows I have to change?

    submitted by /u/FloatingMilkshake
    [link] [comments]

    :)
     
    /u/FloatingMilkshake, Mar 18, 2021
    #1

  2. key authentication

    Quick poll! I finally got around to securing my remote VM by disabling password authentication and using key authentication only for SSH. Curious if others do the same.
     
    Easy Rhino, Mar 18, 2021
    #2
  3. W1zzard Win User
    key authentication

    Key authentication is the recommended method for security, reject all password logins

    If you lose the key use physical or remote console (IPMI)
     
    W1zzard, Mar 18, 2021
    #3
  4. Solaris17 Win User

    Windows not accepting key for SSH key-based authentication?

    key authentication

    I actually recently switched to key authentication myself.
     
    Solaris17, Mar 18, 2021
    #4
Thema:

Windows not accepting key for SSH key-based authentication?

Loading...
  1. Windows not accepting key for SSH key-based authentication? - Similar Threads - accepting key SSH

  2. Trouble Setting Up SSH Key-Based Authentication from Windows to Linux Server

    in Windows 10 Gaming
    Trouble Setting Up SSH Key-Based Authentication from Windows to Linux Server: Hello, I am attempting to set up SSH key-based authentication to log into a Linux server from my Windows 10 machine. While I am able to login using a password, my goal is to enable public key login to avoid using a password each time.Linux SideThe public key has been added to...
  3. Trouble Setting Up SSH Key-Based Authentication from Windows to Linux Server

    in Windows 10 Software and Apps
    Trouble Setting Up SSH Key-Based Authentication from Windows to Linux Server: Hello, I am attempting to set up SSH key-based authentication to log into a Linux server from my Windows 10 machine. While I am able to login using a password, my goal is to enable public key login to avoid using a password each time.Linux SideThe public key has been added to...
  4. Trouble Setting Up SSH Key-Based Authentication from Windows to Linux Server

    in Windows 10 Network and Sharing
    Trouble Setting Up SSH Key-Based Authentication from Windows to Linux Server: Hello, I am attempting to set up SSH key-based authentication to log into a Linux server from my Windows 10 machine. While I am able to login using a password, my goal is to enable public key login to avoid using a password each time.Linux SideThe public key has been added to...
  5. Product Key Not Accepted

    in Windows 10 Software and Apps
    Product Key Not Accepted: I am hoping to transfer a Windows 10 Pro product key from an old laptop to a new Surface Go currently running in S mode.I have copied the key from the old laptop, removed the product key from it, cleared its registry, and have removed the old laptop from my Microsoft...
  6. Product Key Not Accepted

    in Windows 10 Gaming
    Product Key Not Accepted: I am hoping to transfer a Windows 10 Pro product key from an old laptop to a new Surface Go currently running in S mode.I have copied the key from the old laptop, removed the product key from it, cleared its registry, and have removed the old laptop from my Microsoft...
  7. ssh key

    in Windows 10 Ask Insider
    ssh key: I have a windows pc and i want to ssh into it from my phone with a key so I generated a key in my pc. I used “scp \id_rsa.pub user@ip” command but every time i try to connect to my pc using my private key it ask for a password. Anyone can help me? submitted by /u/ZER0-00...
  8. Key Not Accepted

    in Windows 10 Installation and Upgrade
    Key Not Accepted: I have a key for personal Office 365 however when I enter it doesn't install. The card has never been used as I had to scratch of the silver on the card. Cant figure out what is wrong....
  9. Windows not accepting product key

    in Windows 10 Updates and Activation
    Windows not accepting product key: Hello, I seem to be having a problem activating windows 10 on my HP laptop. I bought the laptop a few years ago with windows 8.1 and upgraded it to windows 10 as soon as I got it out of the box. Everything seemed to be ok but the last 12 months or so I keep getting a message...
  10. Activation Key is not accepted

    in Windows 10 Installation and Upgrade
    Activation Key is not accepted: I put in my activation key off of my computer page and it tells me to use another key or purchase one! Help https://answers.microsoft.com/en-us/windows/forum/windows_10-windows_install/activation-key-is-not-accepted/c1c581c1-c0ca-4764-a933-056460e1e984