跳板机常用命令

假设跳板机是10.194.41.69

远程登录10.27.26.13

cat ~/.ssh/config
Host jump
HostName 10.194.41.69

alias skvdcn="ssh [email protected] -o proxycommand=\"ssh jump nc 10.27.26.13 22\""

远程scp

rscp(){
ip=""
for arg in $*
do
    tmp=`echo "$arg" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+"`
    if [ ${#tmp} -gt 1 ]
    then
        ip=$tmp
        break
    fi
done
scp -o proxycommand="ssh jump nc $ip 22" $*
}

你可能感兴趣的:(跳板机常用命令)