How to send password using sftp batch file

前端 未结 6 2308
挽巷
挽巷 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:54

    PSFTP -b path/file_name.sftp user@IP_server -hostkey 1e:52:b1... -pw password
    

    the file content is:

    lcd "path_file for send"
    
    cd path_destination
    
    mput file_name_to_send
    
    quit
    

    to have the hostkey run:

    psftp  user@IP_SERVER
    

提交回复
热议问题