Subscribesftp command in another tab. Just highlight the pwd and cd to that directory.cat > dropoff <>
#!/usr/bin/env bash
# examples:
# dropoff
# ~/.pickup/* -> .
# dropoff server
# server:~/.pickup/* -> .
# dropoff server target
# server:~/.pickup/* -> target
_PICKUPDIR="~/.pickup"
if [ $1 ]; then
scp -r "${1}:${_PICKUPDIR}/*" "${2:-.}"
else
cp --dereference -prv "${_PICKUPDIR}/*" .
fi
EOF
cat > pickup <>
#!/usr/bin/env bash
_PICKUPDIR="~/.pickup"
rm -r ${_PICKUPDIR}
mkdir -p ${_PICKUPDIR}
for FILENAME in "$@"; do
ln -sfv "${PWD}/${FILENAME}" ${_PICKUPDIR}
done
EOF
cat > dropoff <>>>>in my laptop's .ssh/config, and# Let myself connect back in:
RemoteForward 2217 localhost:22
in the .ssh/config of machines I use regularly. This lets me just rsync file mylaptop: on the remote machine.Host mylaptop
User ft
HostName localhost
Port 2217
host innerI quite simply can't do without this functionality; I must use it a hundred times a day.
ProxyCommand ssh outer nc inner %p
Protocol 2
ForwardAgent yes
Host outerto my .ssh/config I no longer have to futz about with checking whether the tunnel is open already or not. Thanks!
LocalForward 2244 inner1:22
LocalForward 2245 inner2:22
...
Host inner1
HostName localhost
Port 2244
ProxyCommand /bin/bash -c ' echo | nc -w1 %h %p >& /dev/null || ssh outer -f exit && nc -w1 %h %p '
You are not logged in, either login or create an account to post comments
Having said that, if you've got sshd running on your local machine, you could set up a port forward when you establish your ssh connection (e.g. map remote port 5000 to local sshd port) so when you find a file you want to copy, just use scp -P 5000 yourfile localhost:/pathonlocalmachine.
Be warned that tunneling SSH over SSH has generally sucky performance. If you've got an FTP server running locally the same trick would work (forward a remote port to your local ftp port) and you can just use something like ncftp to copy files in an ad-hoc fashion.
If you're feeling brave, try setting up an nfs/samba mount over the tunnel instead so you can just copy files to a mounted NFS path on the remote machine and have them magically appear locally.
posted by tkbarbarian at 7:09 AM on June 2