Skip to main content
Tweeted twitter.com/#!/StackUnix/status/565934589173313536
added 48 characters in body
Source Link
slm
  • 379.8k
  • 127
  • 793
  • 897

I can't seem to find a close enough example but here it goes. 

I'm trying to in the end setup rsyncrsync from one server to another through an sshssh tunnel. Local (my machine) will run the rsyncrsync to pull files from a remote server through the sshssh tunnel.

I can connect with this command: $ ssh -L 1522:localhost:middlemanip:1521 user@server

$ ssh -L 1522:localhost:middlemanip:1521 user@server

My rsync attempts led me to try this: $ rsync -avz -e "ssh localhost:1522:middlemanip:1521 ssh" user@server:/source /dest/

$ rsync -avz -e "ssh localhost:1522:middlemanip:1521 ssh" \
    user@server:/source /dest/

But this doesn't seem to work. I moved to autossh where I attempted this -> $ autossh -M 1522 -q -f -N -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -L localhost:middlemanip:1521 user@server where I attempted this:

$ autossh -M 1522 -q -f -N -o "ServerAliveInterval 60" \
    -o "ServerAliveCountMax 3" -L localhost:middlemanip:1521 user@server

No luck so far, but there may be a better way to do this then what I have laid out?

I can't seem to find a close enough example but here goes. I'm trying to in the end setup rsync from one server to another through an ssh tunnel. Local (my machine) will run the rsync to pull files from a remote server through the ssh tunnel.

I can connect with this command: $ ssh -L 1522:localhost:middlemanip:1521 user@server

My rsync attempts led me to try this: $ rsync -avz -e "ssh localhost:1522:middlemanip:1521 ssh" user@server:/source /dest/

But this doesn't seem to work. I moved to autossh where I attempted this -> $ autossh -M 1522 -q -f -N -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -L localhost:middlemanip:1521 user@server

No luck so far, but there may be a better way to do this then what I have laid out?

I can't seem to find a close enough example but here it goes. 

I'm trying to in the end setup rsync from one server to another through an ssh tunnel. Local (my machine) will run the rsync to pull files from a remote server through the ssh tunnel.

I can connect with this command:

$ ssh -L 1522:localhost:middlemanip:1521 user@server

My rsync attempts led me to try this:

$ rsync -avz -e "ssh localhost:1522:middlemanip:1521 ssh" \
    user@server:/source /dest/

But this doesn't seem to work. I moved to autossh where I attempted this:

$ autossh -M 1522 -q -f -N -o "ServerAliveInterval 60" \
    -o "ServerAliveCountMax 3" -L localhost:middlemanip:1521 user@server

No luck so far, but there may be a better way to do this then what I have laid out?

Source Link

SSH Tunnel with autossh

I can't seem to find a close enough example but here goes. I'm trying to in the end setup rsync from one server to another through an ssh tunnel. Local (my machine) will run the rsync to pull files from a remote server through the ssh tunnel.

I can connect with this command: $ ssh -L 1522:localhost:middlemanip:1521 user@server

My rsync attempts led me to try this: $ rsync -avz -e "ssh localhost:1522:middlemanip:1521 ssh" user@server:/source /dest/

But this doesn't seem to work. I moved to autossh where I attempted this -> $ autossh -M 1522 -q -f -N -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -L localhost:middlemanip:1521 user@server

No luck so far, but there may be a better way to do this then what I have laid out?