0

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 3

3

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.

1

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.

0

after i search a bout answer i found we can Automating SFTP using expect ... see the following link Automating SFTP using expect

1
  • So...like I suggested two hours before you awarded yourself the answer? Nice... Dec 11, 2010 at 6:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .