Configure SSH key based not working on Windows

iphonesshwindows 10

I have a shared laptop with Windows 10 at home that I would like to use SSH to log into from my jailbroken iPhone using the NewTerm and OpenSSH tweaks

I used this video to set it up. The SSH connection works but when I try to add a pub key it does not ask for the passphrase of the key instead it ask for the user password

I have followed all the instructions:

  1. I installed and launched the OpenSSH server on Windows.

  2. I created a private/public key with ssh-keygen on the iPhone and scp the pub key to Windows.

  3. Created and secured the administrators_authorized_keys and instead of Administrators:F in the file I had to use Administrateur:F since I use a French Windows.

    Now the SSH command output testuser@windows_ip's password

  4. I set the sshd_config to PubkeyAuthentication yes and PasswordAuthentication no.

After all that the ssh command on the iPhone output Permission denied (publickey,keyboard-interactive).

What am I missing?


EDIT 2: Here are the server side logs. I also updated the log for the client to match the server side

Best Answer

After I had to restart from the beginning because I changed my phone and had to start again and had problems recreating the setup

Here is how I did it

  1. ssh-keygen on the client side
  2. scp id_rsa and id_rsa.pub to C:/Users/X/.ssh for id_rsa and C:/ProgramData/ssh for id_rsa.pub
  3. Use Powershell in administartor with
Get-Service ssh-agent | Set-Service -StartupType Automatic
Start-Service ssh-agent
Get-Service ssh-agent
ssh-add $env:USERPROFILE\.ssh\id_rsa
  1. Using cmd in Administartor
cd C:/ProgramData/ssh
type id_rsa.pub >> administrators_authorized_keys
icacls administrators_authorized_keys /inheritance:r /grant "Administrateurs:F" /grant "SYSTEM:F"

note here Administrateurs needs to be what ever Administrateurs means in your windows default language so Administrators for english

  1. In Services Start/Restart OpenSSH Authentication Agent and OpenSSH SSH Server
  2. ssh user@PC_ip
  3. If it works delete id_rsa and id_rsa.pub
Related Question