Thursday, November 21, 2013

Continuously keep trying a connection

To send continuous packets to a port on a server
useful for when your are tracing packets to troubleshoot a VPN or connection problem.

The following will keep retrying

 while true; do nc <ip address of server> <port>;done 


 while true; do nc 8080;done 
or if you prefer telnet over netcat

while true; do telnet 8080;done 

can also be used to keep retrying your ssh connection until it connects.
while true; do ssh user@ ;done