使用psftp无法忽略错误 [英] Unable to ignore errors using psftp

查看:804
本文介绍了使用psftp无法忽略错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望将本地Windows上C:\Users\myuser\Downloads\SFTP文件夹中的所有文件上传到远程SFTP服务器的myfolder目录.

I wish to upload all files in C:\Users\myuser\Downloads\SFTP folder on my local Windows to a remote SFTP server's myfolder directory.

以下是我的命令:

C:\putty\psftp.exe -b C:\putty\sftp_commands.txt -l myuser -pw mypass 10.8.44.86

这是我的C:\putty\sftp_commands.txt文件:

mkdir myfolder
cd myfolder
lcd "C:\Users\myuser\Downloads\SFTP"
mput "C:\Users\myuser\Downloads\SFTP\*.*"

运行命令会显示以下权限被拒绝错误:

Running the command gives the below permission denied error:

C:\Users\myuser\Desktop>C:\putty\psftp.exe -b C:\putty\sftp_commands.txt -l myuser -pw mypass 10.8.44.86
Using username "myuser".
Pre-authentication banner message from server:
| EFT Server Enterprise 7.3.2.8
End of banner message from server
Keyboard-interactive authentication prompts from server:
End of keyboard-interactive prompts from server
Remote working directory is /
mkdir /myfolder: permission denied

然后,我决定使用psftp的-be参数忽略错误.那是行不通的,我在输出中看到以下错误.

I then decided to ignore errors by using the -be argument to psftp. That does not work and I see the below error in output.

C:\Users\myuser\Desktop>C:\putty\psftp.exe -be C:\putty\sftp_commands.txt -l myuser -pw mypass 10.8.44.86
PuTTY Secure File Transfer (SFTP) client
Release 0.73
Usage: psftp [options] [user@]host
Options:
  -V        print version information and exit
  -pgpfp    print PGP key fingerprints and exit
  -b file   use specified batchfile
  -bc       output batchfile commands
  -be       don't stop batchfile processing if errors
  -v        show verbose messages
  -load sessname  Load settings from saved session
  -l user   connect with specified username
  -P port   connect to specified port
  -pw passw login with specified password
  -1 -2     force use of particular SSH protocol version
  -4 -6     force use of IPv4 or IPv6
  -C        enable compression
  -i key    private key file for user authentication
  -noagent  disable use of Pageant
  -agent    enable use of Pageant
  -hostkey aa:bb:cc:...
            manually specify a host key (may be repeated)
  -batch    disable all interactive prompts
  -no-sanitise-stderr  don't strip control chars from standard error
  -proxycmd command
            use 'command' as local proxy
  -sshlog file
  -sshrawlog file
            log protocol details to a file

C:\Users\myuser\Desktop>

请问我的代码有什么问题吗?

Can you please suggest what is wrong with my code?

推荐答案

The -be and -b are separate switches. So it should be:

psftp.exe -be -b C:\putty\sftp_commands.txt ...

这篇关于使用psftp无法忽略错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆