title: Netcat:use a script to test ports are open from a given source-host to remote-host using netcat
body: <p>I am trying to use a script to test ports are open from a given source-host to remote-host using netcat</p>
  <p>So from a bastion, get the script to ssh to  a source and from that source-host nc -v remote-host 1521
  Ideally i will want to test from the source-host to multiple destinations
  As an example:</p>
  <h1>/bin/bash</h1>
  <p>kinit # prompt for my creds</p>
  <p>ssh source-host nc -v -n remote-host 1521</p>
  <p>When I run script it will prompt for creds and then get error:</p>
  <p>nc: gettaddrinfo: Name or service no known.</p>
  <p>I suspect it is the -n flag but when I try without, it hangs</p>
  <p>Any ideas of what I am doing wrong and how I can achieve in simplest way</p>