Score:1

SSH passwordless connetion from Ubuntu to Win10

mz flag

I am trying to establish passwordless ssh connection from Ubuntu 20.04 to Win 10. I installed new Win10 (downloaded from Microsoft site, no activated). I downloaded openssh from git (OpenSSH_for_Windows_8.6p1, LibreSSL 3.3.3) I created file for my win user user/.ssh/authorized_keys and copied (with scp) my public key from ubunutu machine to it. I checked that my key exists on remote machine.

sshd_settings: 
PubkeyAuthentication yes 
PasswordAuthentication yes  
AuthorizedKeysFile - tried default .ssh/authorized_keys, %USERPROFILES\.ssh/authorized_keys%, with no this parameter.

Regular ssh connection with password works fine. Firewall was turned off. I did same for establish ssh passwordless connection linux to linux - work fine.

I read a lot of articles: I have to create key, copy it to remote machine, reload sshd service and everything should work fine. For linux to linux it works as expected but linux to win10.

Should I have some extra settings? Should I have extra permissions? What did I do wrong? Could someone help me plz?

UPDATED: I did it. In MS docs said if user is admin you should place keys to another place %programdata%/ssh/administrators_authorized_keys but for me it did not work. And I found row in the bottom of sshd_setting about this requirements and just removed it. Now everything works fine and as expected.

in flag
Just to confirm, the problem is with OpenSSH Server *on Windows*, correct?
koko avatar
mz flag
yes, I can not establish connection from Ubuntu to Windows.
marosg avatar
vn flag
"user/.ssh/authorized_keys and copied (with scp) my private key from ubunutu machine to it" you need to copy public key there, not private
koko avatar
mz flag
sorry, its mistake in explanation, I definitely copied public key
in flag
How are you connecting from Ubuntu? Are you including the key? For example: `ssh -i ~/.ssh/id_rsa [email protected]`
koko avatar
mz flag
I was connecting `ssh [email protected]`. I tried to use your variant - I got asked password
Johan Palych avatar
us flag
Try it like this: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null user@ip
koko avatar
mz flag
I got `Warning: Permanently added 'ip' (ECDSA) to the list of known hosts.` but I also got asked password. I think it is problem in Windows. I will try ti provide more info a little late.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.