2024年最全VScode远程连接linux_vscode远程连接linux服务器-CSDN博客
全局安装 yarn npm install -g yarn
有时缓存问题会导致安装变慢,尝试清理缓存:npm cache clean --force
尝试更换镜像源:
npm config set registry https://registry.npm.taobao.org
npm config set registry https://registry.npmmirror.com



如果希望 VS Code 记住已转发的任何端口,请在设置编辑器 (⌘,) 中选中"Remote: Restore Forwarded Ports"或在 settings.json 中设置 "remote.restoreForwardedPorts": true 。

实现在连接时,自动转发端口,可以将以下内容添加到~/.ssh/config文件中
# SSH config file
Host remote-linux-machine
User myuser
HostName remote-linux-machine.mydomain
LocalForward 127.0.0.1:3000 127.0.0.1:3000
LocalForward 127.0.0.1:27017 127.0.0.1:27017
# 将【remote-linux-machine】服务器中内网的端口转发到本地,并手动配置域名到hosts中,实现通过域名访问服务器内网中的端口
LocalForward kuboard.intranet.company:30084 172.17.0.2:80
到此就实现了通过端口转发,在本地电脑上访问远程服务器上的内网的服务的功能。