i write bash file contain sftp command ... but i have problem every time i execute bash sftp requests password of the remote server .. how i can give sftp password as default parameter ???
3 Answers
SFTP uses SSH protocol. So, you can generate certificates using ssh-keygen
and copy it to the remote server using ssh-copy-id
. This way you can login without a password.
for more details, have a look at this page.
Khaled's answer is probably your best option. You can also use expect for this, good for instances where you are not allowed to install keys for one reason or another.
after i search a bout answer i found we can Automating SFTP using expect ... see the following link Automating SFTP using expect
-
So...like I suggested two hours before you awarded yourself the answer? Nice... Dec 11, 2010 at 6:46