使用curl连接vsftpd服务器,设置ssl_enable=NO可以连接,ssl_enable=YES则失败

使用curl连接vsftpd服务器,设置ssl_enable=NO可以连接,ssl_enable=YES则失败
设置ssl_enable=YES
使用curl -u test:123456 ftp://192.168.10.110连接vsftpd

报错:curl: (67) Access denied: 530

日志显示:DEBUG: Client "::192.168.10.110", "Control connection terminated without SSL shutdown."

防火墙打开了监听端口20和21,允许本地用户去连vsftpd(在filizilla中连过了),就是使用curl命令行连接就出现问题,是curl需要设置什么选项采取能使用ssl连接vsftpd吗?是怎么设置的呢

可以尝试指定参数 --insecure 忽略对本地ssl证书的校验,如:

curl -u 用户名:密码 sftp -v --data-urlencode --insecure sftp://IP地址
# 或
curl -u 用户名:密码 sftp -v --data-urlencode --insecure --pubkey "公钥文件名" sftp://IP地址

验证截图:

img


  1. 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".
  1. 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
  1. 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

开启ssl时用curl ftps://192.168.xx.xx试试看

尝试指定参数