I have a bit of a confusion using WSL 2 on my Windows 10 machine regarding user names.
When I installed Windows 10 using my Microsoft Account, it created the user phili.
When I am in a powershell, the user home defaults to:
C:\Users\phili\ which is /mnt/c/Users/phili/.ssh in WSL bash.
When I go to bash on WSL and cd ~ I end up in /home/phil.
The username in WSL seems to be phil which is different from the Windows username phili. I am not sure but I might have picked phil when installing WSL.
The problem I have is, that when I try to SSH into my WSL from my Macbook with ssh phil@<windows-host-ip> it won't accept my password (I have tried to change the pw also, no success). I can only login with ssh phili@<windows-host-ip> and my Windows password.
If I install the public key on my windows machine from my Macbook using ssh-copy-id phili@<windows-host-ip> it places them in /home/phil/.ssh/authorized_keys and not in C:\Users\phili\.ssh\authorized_keys.
EDIT: The files in /mnt/c/Users/phili/ are owned by user phil
phil@PHIL-DESKTOP:/mnt/c/Users/phili/.ssh$ ls
total 0
-rwxrwxrwx 1 phil phil 28 Oct 3 14:39 authorized_keys
Of course I could copy the public key manually, but this is not the point.
How can I clear up this mess with those usernames?
- change the username in WSL to
phili? - change the username in Windows from
philitophil?
I would prefer to use the username phil if possible.
Thanks for any tips.