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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM