I'm trying to set up an ssh server on my windows 10 machine through WSL (I'm using WSL 1 if this makes a difference), running ubuntu.
So I followed this tutorial. Basically I installed open-ssh from the command line, and I created a new user by adding AllowUsers <yourusername> in /etc/ssh/sshd_config. I also made sure the firewall was allowing connections to port 22.
Then I went to my other laptop (the one I'm trying to ssh from), which is a mac, and typed ssh 192.168.X.X which is my windows' machine private ip (it's static btw). Both my windows machine (the ssh server), and my mac machine (the ssh client) are on the same network, which is why I'm sshing using a private ip.
For some reason I'm asked to input a password, but I don't know what password I should use. I tried my windows machine login password, as well as my WSL admin password (the one I use when executing sudo commands). Both didn't work. I'm pretty sure this is something obvious because I haven't found any solution on this online, so it must be something really stupid that doesn't even need to be asked...
I also tried ssh <yourusername>@192.168.X.X where <yourusername> is the one I added in /etc/ssh/sshd_config, but I was also required to input a password.
Edit:
I tried ssh localhost but got
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the ECDSA key sent by the remote host is SHA256:xxxxx.
Please contact your system administrator. Add correct host key in /home/user/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /home/user/.ssh/known_hosts:1 remove with: ssh-keygen -f "/home/user/.ssh/known_hosts" -R "localhost" ECDSA host key for localhost has changed and you have requested strict checking. Host key verification failed.
(I put xxx instead of the fingerprint and user instead of my username for privacy). I also stopped my ssh server and closed my open port because I'm worried something bad is happening, which is really weird.
ssh localhostand see if you can access it there with your WSL user's password. What happens?ssh localhostbut got