Skip to content

Instantly share code, notes, and snippets.

@dcb9
Last active January 4, 2021 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcb9/65a524d47dda5ee734686ccd7aa1e12d to your computer and use it in GitHub Desktop.
Save dcb9/65a524d47dda5ee734686ccd7aa1e12d to your computer and use it in GitHub Desktop.
VSCode rmate:使用本地 VSCode 访问和修改远程计算机文件

1. [本地] VSCode 安装 Remote VSCode

2. [服务器] 安装 https://github.com/aurora/rmate

sudo wget -O /usr/local/bin/rmate https://raw.githubusercontent.com/aurora/rmate/master/rmate
sudo chmod a+x /usr/local/bin/rmate

3. [本地] VSCode 运行

  • F1 并输入 Remote: Start server
  • 创建 SSH Tunnel: ssh -R 52698:127.0.0.1:52698 user@example.org

4. [服务器] 打开文件

  • rmate -p 52698 file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment