gpt4 book ai didi

error-handling - 无法使用 psftp 忽略错误

转载 作者:行者123 更新时间:2023-12-03 07:41:29 26 4
gpt4 key购买 nike

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

下面是我的命令:

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\*.*"

运行该命令会出现以下权限被拒绝的错误:

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 参数来忽略错误。这不起作用,我在输出中看到以下错误。

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>

你能建议我的代码有什么问题吗?

最佳答案

-be-b是单独的开关。所以应该是:

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

关于error-handling - 无法使用 psftp 忽略错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59425549/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com