How to send password using sftp batch file

前端 未结 6 2316
挽巷
挽巷 2020-12-08 19:05

I\'m trying to download a file from sftp site using batch script. I\'m getting the following error:

Permission denied (publickey,password,keyboard-interactiv         


        
6条回答
  •  不知归路
    2020-12-08 20:08

    If you are generating a heap of commands to be run, then call that script from a terminal, you can try the following.

    sftp login@host < /path/to/command/list
    

    You will then be asked to enter your password (as per normal) however all the commands in the script run after that.

    This is clearly not a completely automated option that can be used in a cron job, but it can be used from a terminal.

提交回复
热议问题