Created
October 16, 2018 13:59
-
-
Save maesoser/2a2befa48c9ffd0999f889f0d30708ff to your computer and use it in GitHub Desktop.
far-ssh and far-scp, when you need to access or copy files through a server acting as a proxy.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function far-scp | |
if count $argv > /dev/null | |
echo Connecting through $argv[1] | |
echo Source: $argv[2] | |
echo Dest: $argv[3] | |
scp -oProxyJump=$argv[1] $argv[2] $argv[3] | |
else | |
echo " usage: far-scp [proxy-addr] [src] [dst]" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function far-ssh | |
if count $argv > /dev/null | |
echo Connecting to $argv[2] through $argv[1] | |
ssh -t $argv[1] ssh $argv[2] | |
else | |
echo " usage: far-ssh [proxy-ssh] [target-ssh]" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment