可以尝试指定参数 --insecure
忽略对本地ssl证书的校验,如:
curl -u 用户名:密码 sftp -v --data-urlencode --insecure sftp://IP地址
# 或
curl -u 用户名:密码 sftp -v --data-urlencode --insecure --pubkey "公钥文件名" sftp://IP地址
验证截图:
- curl 基本语法
$ curl --help
--------------------------------------------------------------------------------
Usage: curl [options...] <url>
-d, --data <data> HTTP POST data
-f, --fail Fail fast with no output on HTTP errors
-h, --help <category> Get help for commands
-i, --include Include protocol response headers in the output
-o, --output <file> Write to file instead of stdout
-O, --remote-name Write output to a file named as the remote file
-s, --silent Silent mode
-T, --upload-file <file> Transfer local FILE to destination
-u, --user <user:password> Server user and password
-A, --user-agent <name> Send User-Agent <name> to server
-v, --verbose Make the operation more talkative
-V, --version Show version number and quit
This is not the full help, this menu is stripped into categories.
Use "--help category" to get an overview of all categories.
For all options use the manual or "--help all".
- curl 语法
非交互模式
可用参数
$ curl --help silent
--------------------------------------------------------------------------------
Usage: curl [options...] <url>
Invalid category provided, here is a list of all categories:
auth Different types of authentication methods
connection Low level networking operations
curl The command line tool itself
dns General DNS options
file FILE protocol options
ftp FTP protocol options
http HTTP and HTTPS protocol options
imap IMAP protocol options
misc Options that don't fit into any other category
output Filesystem output
pop3 POP3 protocol options
post HTTP Post specific options
proxy All options related to proxies
scp SCP protocol options
sftp SFTP protocol options
smtp SMTP protocol options
ssh SSH protocol options
telnet TELNET protocol options
tftp TFTP protocol options
tls All TLS/SSL related options
upload All options for uploads
verbose Options related to any kind of command line output of curl
- curl 语法
非交互模式
sftp参数
$ curl --help sftp
--------------------------------------------------------------------------------
Usage: curl [options...] <url>
sftp: SFTP protocol options
-a, --append Append to target file when uploading
--create-file-mode <mode> File mode for created files
--ftp-create-dirs Create the remote dirs if not present
--hostpubmd5 <md5> Acceptable MD5 hash of the host public key
--hostpubsha256 <sha256> Acceptable SHA256 hash of the host public key
-k, --insecure Allow insecure server connections
--pubkey <key> SSH Public key file name
-Q, --quote <command> Send command(s) to server before transfer
-r, --range <range> Retrieve only the bytes within RANGE