lagu

Kamis, 24 November 2016

tiny-ssh-tunnel

#!/bin/sh

 H1="+++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
H2="+ Tiny SSH Tunnel - Bash Script by Perforin [vxnetw0rk] +\n" H3="+++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"

 if [ $# -gt 3 ];

then

 echo "script.sh PORT USER SERVER"
 exit
elif [ $# -eq 3 ] ;

then

echo "$H1$H2$H3"
ssh -ND $1 $2@$3

else

echo "Local Port: "
read LOCALPORT
 if [ $LOCALPORT -lt 1025 ]; then
echo "You need to be root to use this port!\n"
exit

fi

echo "Remote Server: "
read REMOTESERVER

echo "Remote User: "
read REMOTEUSER

clear

echo "$H1$H2$H3"
ssh -ND $LOCALPORT $REMOTEUSER@$REMOTESERVER

fi

Tidak ada komentar: