sshpass –e sftp –b filelist.txt firstname.lastname@example.org:/home/theuser << EOF bye EOFAssuming there is no problem found in filelist.txt, if the file transfer script is execute, the following error would be seen:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
Couldn't read packet: Connection reset by peer
Running the sftp command with –v option shows that it seems not able to find the key pair for authentication. Later I found out that missing oBatchMode option may failed the process, thus this should be the work around I found in forum.
sshpass –e sftp –oBatchMode=no –b filelist.txt email@example.com:/home/theuser << EOF bye EOF