On 1/8/24 07:48, Andreas Fink wrote:
On Sat, 6 Jan 2024 20:09:37 -0700
the...@sys-concept.com wrote:

I installed openssh server on Windows 11 and tried to ssh to it using the 
id_rsa.pub key
but I didn't have luck.  I copied the key to .ssh\authorized_keys file.
On linux the last line ending with "\"  on Windows Notepad replaces it with the 
"+" sign.

ssh with password is working  but windows doesn't recognize the public key or 
maybe it is wrong directory  C:\Users\Garry Server\.ssh\authorized_keys


If ssh with password is working, did you try letting ssh decide for the
correct location for your ssh key via ssh-copy-id:
ssh-copy-id -i ~/.ssh/my_key usern...@example.com

First time it will of course log in via password, but any further login
should use the ssh key.

If the key is still not accepted, have you tried a different ssh key
type (e.g. ed25519). Maybe the server rejects RSA keys?

Nice command, thank for the input; but it didn't work with Windows 11

I run:
ssh-copy-id -i ~/.ssh/id_rsa.pub "Glen Server"@10.0.0.130
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: 
"/home/joseph/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter 
out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are 
prompted now it is to install the new keys
Glen Server@10.0.0.130's password:
'exec' is not recognized as an internal or external command,
operable program or batch file.

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'Glen Server@10.0.0.130'"
and check to make sure that only the key(s) you wanted were added.

Trying to login again still asked me for password.
On Windows 11 public key should be copied to 
C:\ProgramData\ssh\administrators_authorized_keys

Reply via email to