Can anyone explain me how following works ?
This command checks if eg.
remote host 10.2.12.25 or 10.2.12.26 has a daemon listening on port 22 / or port 22 is open. If it's TRUE, returns value 0, if not 1.
Very useful for me. The only question is how does that work ?
I checked in my system - /dev/tcp does not exist... so how is that possible it works ?
Code:
# bash -c 'exec 3<> /dev/tcp/'10.2.12.25'/'22';echo $?' 2>/dev/null
0
# bash -c 'exec 3<> /dev/tcp/'10.2.12.26'/'22';echo $?' 2>/dev/null
1