ddev / ddev-contrib

MOSTLY OBSOLETE, replaced by DDEV Add-ons. Was older contrib space for DDEV services, tools, snippets, and approaches.
Apache License 2.0
162 stars 160 forks source link

"Permission denied" error when using SSH server on Win10 #198

Closed tyler36 closed 2 years ago

tyler36 commented 2 years ago

I'm trying to follow the SSH setup on a Win10 PC.

When I run the command, I am prompted for a password, but I always get a denied error.

ssh -p 2222 -o StrictHostKeyChecking=no localhost
lost\user13@localhost's password: 
Permission denied, please try again.

If I try ssh-add, the password is accepted.

I have it working in WSL though I think it might there might be an issue with Win10?

OS: Win10 DDEV: Win10 DDEV 1.18.2, 1.19.0-alpha3 WSL: 1.19.0-alpha3

rfay commented 2 years ago

You'll want to debug this with ssh -vvv, etc. And you'll want to review the logs of the sshd.

tyler36 commented 2 years ago

Ahhh .... Win10 was sending a Down-Level Logon Name

$ ssh -p 2222 -o StrictHostKeyChecking=no localhost lost\user13@localhost's password: Permission denied, please try again.


- But WSL only sends the username
```shell
$ whoami
user13

$ ssh -p 2222 -o StrictHostKeyChecking=no localhost
Enter passphrase for key '/home/user13/.ssh/id_rsa':

So, I need to specify the username when I run from Win10:

$ ssh -p 2222 -o StrictHostKeyChecking=no user13@localhost
user13@example-web:~$ 

Also confirmed: updating my Win10 SSH ~/.ssh/config file, I can connect to the DDEV box via VSCode Remote: SSH extension

Host ExampleDDEV
    HostName localhost
    Port 2222
    StrictHostKeyChecking OFF
    User user13
tyler36 commented 2 years ago

PR was submitted to help others with similar issue.

rfay commented 2 years ago

Nice work!

rfay commented 2 years ago

Could you retitle this issue to make it more search friendly, say more about what "not working" meant in the title?