How to transfer data remotely to PCs in LAN via SFTP?



Hi,

I want to automate transferring file or folder to 20 PCs connected via
the same LAN..

The problem i face is that they need to enter password and i don't
know how to pass it in the code syntax..

Sample Code:
for i in (1:20) # 20 PCs
do
sftp user(at)10.0.0.$i # to log-in remotely to PCs one by one
# Password should be entered here!! How to ??
put $file ; # transfer the file to destination PC
exit # come back to current shell
done # will go to log-in to the next PC

I want to either override password promot, or find a way to pass it
automatically to the standard input ..

P.S. I have the root password and everything.

Can anyone help me please? I'm not a programmer in fact, so if you see
that my code is weak, please correct it to me..

Thanks in advance,
Ahmad,

.



Relevant Pages