How to send password using sftp batch file

前端 未结 6 2311
挽巷
挽巷 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 19:49

    I advise you to run sftp with -v option. It becomes much easier to fathom what is happening.

    The manual clearly states:

    The final usage format allows for automated sessions using the -b option. In such cases, it is necessary to configure non-interactive authentication to obviate the need to enter a password at connection time (see sshd(8) and ssh-keygen(1) for details).

    In other words you have to establish a publickey authentication. Then you'll be able to run a batch script.

    P.S. It is wrong to put your password in your batch file.

提交回复
热议问题