ssh

server

ssh  - - - 10000 : localhost : 22  lyb@ 3322 . org


client
ssh lyb @localhost   - 10000


 1 # !/bin/bash
 2 while  true; do
 3 RET = `ps ax  |   grep   " ssh -f -N -R 10000:localhost:22 "   |   grep   - " grep " `
 4 if  [  " $RET "   =   ""  ]; then
 5 echo  " restart ssh server "
 6 ssh  - - - 10000 : localhost : 22  lyb @hahalee . 3322 . org
 7 fi
 8 sleep   10
 9 done
10


你可能感兴趣的:(ssh)