title: Does SFTP need Bi-Directional access
body: <p>I have following script to get given file from given remote directory by accepting following parameters</p>
  
  <ol>
  <li>Host Name that you are connecting to get File</li>
  <li>User Name of the Host</li>
  <li>Local Directory where you wanted to transfer file</li>
  <li>Remote Directory from where you wanted to get file</li>
  <li>File name that you wanted to get from Remote server</li>
  </ol>
  
   
  
  <pre><code>FSERVER=$1
  FUSER=$2
  SRC_DIR=$3
  REMOTE_SRC_DIR=$4
  FILE_NAME=$5
  
  cd $SRC_DIR
  sftp $FUSER@$FSERVER &lt;&lt;GOTO
  cd $REMOTE_SRC_DIR 
  ascii
  get $FILE_NAME 
  bye
  </code></pre>
  
  <p>To access the files from <code>$REMOTE_SRC_DIR</code> to <code>SRC_DIR</code> do I need port open from both side? I.e. bi-directional or just one port from Remote Server to Source and it should need "INITIATE" session from the source. And what is the reason?</p>
  
  <p>As per my understanding we are connecting to remote server path and then writing the query Get File name. So we need to bi-directional access.</p>