This is my own note post. Generally, I can use other shells and still be able to connect, but suddenly vscode cannot connect or the extension is not working in the server/container.
1. Directly clear the knowhost and try again
2. ctrl + shift + p and then search for kill, kill Vscode Server on Host, delete and reinstall it
3. Use Openssh to do
Download link
https://www.mls-software.com/opensshd.html
After installation, change these two places