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