0
Questions like How to remotely write to a file using SSH are about a direct SSH.
But I am reaching the end of a reverse tunnel which ends on intermediateserver. That is, I'm ssh'ing to one machine through another. And I want to write to a file on the distant machine. The following fails; it ends up writing on the intermediateserver!
ssh -A -t intermediateserver ssh -A -t -p 666 localhost "echo 30 > tmp"
The fact that there's a reverse ssh tunnel in there probably doesn't make things more complicated, so more generally, I am sitting on homeserver and going through intermediateserver to distantserver.
(In my case here, distant server appears to intermediate server internally on its port 666, due to a preexisting reverse tunnel) .
If you’re
ssh
ing from “intermediateserver” tolocalhost
, then you’re still on “intermediateserver”. Where are you connecting to a distant machine? You say that the tunnel ends on “intermediateserver”, so what machine is more distant than the end of the line? – Scott – 2018-11-02T05:47:56.183I've edited for clarity. My situation is probably a bit more complex than relevant to the question. – CPBL – 2018-11-02T16:09:02.467