Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ???

share|improve this question

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.

share|improve this answer

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.

share|improve this answer
up vote 0 down vote accepted

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

share|improve this answer I suggested two hours before you awarded yourself the answer? Nice... – CarpeNoctem Dec 11 '10 at 6:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.