Created
April 1, 2014 19:27
-
-
Save zero-master/9921261 to your computer and use it in GitHub Desktop.
Check if SSH Tunnel Started Successfully!
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
Use netcat -- often nc on Linux systems: | |
nc -dvzw10 ${HOSTNAME} 23 | |
Works for me, with a response like: | |
Connection to ${HOSTNAME} 23 port [tcp/telnet] succeeded! | |
It also returns 0 on success, and is happy with a simple connection after which it goes away. | |
-d means not to read anything from the keyboard side | |
-v means to be verbose (turn this off in a script) | |
-z means to disconnect after making the connection | |
-w10 means to wait up to 10 seconds, otherwise give up |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment