Last active
October 8, 2019 15:55
-
-
Save marvin-marvin/e5e58ea01a6ff3e6b2eef2b1ba878a60 to your computer and use it in GitHub Desktop.
check ssh on multiple servers from file
This file contains hidden or 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
#check ssh login on multiple servers from file | |
for i in `awk '{print $3}' <STAGING>/FILE.txt`; do echo $i ; ssh -i <STAGING>/KEY -n root@$i "echo OK" ; done |
This file contains hidden or 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
#check ssh port on multiple servers from file | |
for i in `awk '{print $3}' <STAGING>/FILE.txt`; do echo $i ; nc -zw3 $i 22 && echo "opened" || echo "closed" ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment