ckssh.py 292 B

12345678910111213
  1. #!/usr/bin/env python
  2. # Author: yeho <lj2007331 AT gmail.com>
  3. # Blog: http://linuxeye.com
  4. import socket,sys
  5. sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  6. sk.settimeout(1)
  7. try:
  8. sk.connect((sys.argv[1],int(sys.argv[2])))
  9. print ('ok')
  10. except Exception:
  11. print ('no')
  12. sk.close()