원격 서버에서 실행되는 편집기를 사용하여 로컬 파일을 여는 방법

원격 서버에서 실행되는 편집기를 사용하여 로컬 파일을 여는 방법

다음과 같은 원격 서버에서 프로그램을 실행할 수 있습니다.

ssh -Y [email protected] gvim

그러나 gvim은 원격 서버의 파일만 볼 수 있습니다. 원격 서버에서 프로그램을 실행할 수 있지만 로컬 파일에서는 실행할 수 있습니까?

답변1

로컬 머신이 SSH를 실행 중이어야 합니다. 그러면 다음을 수행할 수 있습니다.

localusername@localmachine: ssh username@server -R 10000:localmachine:22
username@server: cd /var
username@server: sshfs -p 10000 -o idmap=user,nonempty \
                 [email protected]:~/mywwwdevelstuff www

에서 가져옴https://superuser.com/a/918708/25609

답변2

먼저 scp로컬 파일을 원격 서버로 전송합니다.

물론 로컬 시스템에 gvim을 설치하는 것이 더 나을 수도 있습니다.

답변3

다음과 같이 원격 컴퓨터에서 프로그램을 실행할 수 있습니다. ssh -t <user>@<remote host> '<program to execute with full path and arguments>'

     -t      Force pseudo-terminal allocation.  This can be used to execute arbitrary
             screen-based programs on a remote machine, which can be very useful, e.g.
             when implementing menu services.  Multiple -t options force tty allocation,
             even if ssh has no local tty.

관련 정보