Loading

vscode 远程编辑文件

操作

安装扩展

remote-vscode

配置ssh 转发:
添加 RemoteForward 52698 127.0.0.1:52698 到 ~/.ssh/config:

# Read more about SSH config files: https://linux.die.net/man/5/ssh_config
# Host localu1
#     HostName 128.196.126.142
#     User xxxx
#     IdentityFile ~/.ssh/id_rsa.pub

# Host textlalel
#     HostName 192.168.1.149
#     User xxxx
#     IdentityFile ~/.ssh/id_rsa.pub



Host myRemoteServerName
    HostName 12.34.567.89
    User root
    ForwardAgent yes
    RemoteForward 52698 127.0.0.1:52698

连接远程

ssh -v myRemoteServerName

在被控制端操作(已经登录):
安装rmate

wget -O /usr/local/bin/rcode https://raw.github.com/aurora/rmate/master/rmate &&chmod a+x /usr/local/bin/rcode

操作某个文件:

#重新登陆远程, 运行
rmate some_file.php

文件出现在vscode

其他方式

使用ssh:已经测试

https://blog.csdn.net/qq756684177/article/details/94236990
https://github.com/cdr/code-server/releases

posted @ 2019-12-17 15:22  Lust4Life  阅读(709)  评论(0编辑  收藏  举报