xxxxxxxxxx
For those trying to connect through Vscode Remote SSH Extension steps provided at https://code.visualstudio.com/docs/remote/troubleshooting#_ssh-tips)
For Windows(Host) --> Linux(Remote)
Create an SSH .pub key in your windows using power shell:
ssh-keygen -t rsa -b 4096
Send to Remote machine and append the contents of the pub key in authorized keys echo "pub-key.pub" >> ~/.ssh/authorized_keys
Using this command: (Your public key by default is stored in your directory [Users/<user>/.ssh/])
cat ~/.ssh/id_rsa.pub | ssh root@xxx.xx.xxx.xxx 'cat - >> ~/.ssh/authorized_keys'
xxxxxxxxxx
To close the connection when you finish editing files on the remote host,
choose File > Close Remote Connection to disconnect from the host.