title: Can a SSH key created by one User ID be used by other ID for SFTP?
body: <p>I am new to to UNix scipt and SFTP process. I need to write a KSH script by which I can transfer files to a sftp server. I have created the SSH  key pairs. I have developed the KSH code as well. But every time the KSH script is being executed by other ID , its prompting for password where as when I am executing the same it is not asking for any password even though the group id for these 2 user ids are same. Below is my section where I am sending the files</p>
  
  <pre><code>###################################################
  # SFTP to MFT ---&gt; SFTP to MFT ---&gt; SFTP to MFT   #
  ###################################################
  # Execute SFTP command to PUT a file on MFT       #
  #  $1 - SSH Private Key File                      #
  #  $2 - SFTP User ID @ MFT Server                 #
  #  $3 - Source Directory (to take files from)     #
  #  $4 - MFT Directory    (to place files into)    #
  #  $5 - File to MPUT                              #
  #  $6 - MFT PWD                                   #
  ###################################################
  function sftpputtomft {
  
  sftp -o identityfile=${1} ${2} &gt;&gt; $SFTP_LOG &lt;&lt; ENDSFTP
     lcd  ${3}
     cd   ${4}
     mput ${5}
     bye
  ENDSFTP
  </code></pre>