
リモートサーバー上でプログラムを実行するには、次のようにします。
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
答え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.