大部分问题这里可以解决VSCode 连不上远程服务器问题及解决办法集合
但是我遇到的问题都不在这里面,我的任何配置都没问题,防火墙是通的,终端ssh也是通的,但就是连不上,就一直卡在opening Remote…
尝试过以下操作:
一、重置C盘缓存文件
删除C:\Users\Administrator\.ssh
二、修改服务器 sshd_config 中的配置
改了一堆忙活半天最后没用,很多人推荐PermitRootLogin 改为no,没用的
最后cp /etc/ssh/sshd_config.rpmnew /etc/ssh/sshd_config进行还原,再sudo systemctl restart sshd进行重启
三、删除remote-ssh配置
在vscode页面按下 Ctrl+Shift+P ,在>后输入以下内容然后点击
remote-ssh: kill vs code server on host
四、删除服务器的vscode配置
rm -rf ~/.vscode-server/
还有很多方案都尝试过,都没有
成功方案
方案一:
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
sudo service iptables save
sudo service iptables restart
方案二:
vim /etc/ssh/sshd_config
修改 no 为 yes
AllowTcpForwarding yes
AllowAgentForwarding yes
wq保存,再执行sshd重启
systemctl restart sshd
3571

被折叠的 条评论
为什么被折叠?



