AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[ftps](server)

Martin Hope
Peter Nunn
Asked: 2022-04-06 18:03:21 +0800 CST

将文件从远程 ftp 服务器移动到本地

  • 0

我需要定期从 ftp 服务器中提取文件,并且发现我可以使用 wget 轻松获取文件

wget -m --user=yyy --password=xxxx ftps://host.com.au

这真的很好用。问题是,它显然将文件留在了远程服务器上,下次我运行脚本时,它会再次获取它们。

我看到 wget 有一个 --delete-after 标志,乍一看似乎很理想,但是,正如手册页所说,它只删除本地文件而不是远程文件。

有没有办法达到这个目的?不幸的是,它需要通过 ftp,因为我没有对远程服务器的 shell 访问或 rsync 访问。我应该看wget以外的东西吗?

file-transfer ftps wget
  • 1 个回答
  • 120 Views
Martin Hope
Hooman Bahreini
Asked: 2021-12-07 15:00:59 +0800 CST

同一服务器能否同时接受显式和隐式 FTPS?

  • 0

我在 Ubuntu 服务器上使用 VSFTPD。

我有 2 个客户端想要连接到这个 FTP 服务器,其中一个使用带有显式身份验证的 FTPS,另一个客户端使用带有隐式身份验证的 FTPS。

无论如何可以配置 VSFTPD,以接受隐式和显式身份验证?

这是我的 /etc/vsftpd.conf:

listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=NO
# pasv_address=13.55.13.221 
idle_session_timeout=1200
data_connection_timeout=3600
accept_timeout=500
connect_timeout=5000
allow_writeable_chroot=YES
chroot_local_user=YES
user_sub_token=$USER
local_root=/home/$USER/uploads
pasv_enable=YES
pasv_min_port=40000
pasv_max_port=50000
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
require_ssl_reuse=NO
ssl_ciphers=HIGH
utf8_filesystem=YES
ftp vsftpd ftps
  • 1 个回答
  • 243 Views
Martin Hope
Hooman Bahreini
Asked: 2021-11-25 21:56:56 +0800 CST

FTPS 错误:Winsock 错误 10060

  • 0

我已经使用 vsftps 在 ubuntu 上设置了一个 FTPS 服务器

以下是 FTP 配置:sudo vim /etc/vsftpd.conf

listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=NO
# pasv_address=13.55.13.221 
idle_session_timeout=1200
data_connection_timeout=3600
accept_timeout=500
connect_timeout=5000
allow_writeable_chroot=YES
chroot_local_user=YES
user_sub_token=$USER
local_root=/home/$USER/uploads
pasv_enable=YES
pasv_min_port=40000
pasv_max_port=50000
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
require_ssl_reuse=NO
ssl_ciphers=HIGH
utf8_filesystem=YES

我使用 Core FTP LE 测试服务器,我有三个选项:

  1. AUTH SSL <-- 工作正常 在此处输入图像描述

  1. 身份验证 TLS <-- 工作正常 在此处输入图像描述

  1. FTPS (SSL Direct) <-- 不工作 在此处输入图像描述

这是我得到的错误:

SSL/TLS 错误 - 0,SSL 错误 - 1,错误:00000001:lib(0):func(0):reason(1) Winsock 错误 10060(连接尝试失败,因为连接方在一段时间后没有正确响应时间,或建立连接失败,因为连接的主机未能响应。) SSL 连接未建立

知道如何使 FTPS 选项正常工作吗?

ftp ssl ftps openssl
  • 1 个回答
  • 170 Views
Martin Hope
Sam
Asked: 2020-05-20 00:27:18 +0800 CST

如何在 SliTaz 中使用 proftpd

  • 1

我想在 SliTaz 上使用 FTP over TLS。我已经使用以下命令安装了 proftpd:

tazpkg get-install proftpd

我习惯于在 SliTaz 上启动和停止程序,/etc/init.d/program start or stop但我不知道如何启动 proftpd,因为没有 /etc/init.d/proftpd。

proftpd 配置仍然是默认配置,我尝试与 FileZilla 连接,但在验证用户身份后无法连接到服务器。

SliTaz (5.0) 是 Windows 10 主机上的虚拟机。我尝试在主机上使用 FileZilla 到 SliTaz 主机专用 ip。

如何在 SliTaz 上配置 proftpd?

编辑

proftpd我发现我可以通过在命令行中输入来启动 proftpd 。我确实有一个/etc/proftpd.conf文件,但是当我更改文件中的某些内容时不会更改。我不能使用proftpd restart,所以我假设proftpd 重新加载只是proftpd?

我尝试在以下行中使用 TLS /etc/proftpd.conf:

<IfModule mod_tls.c>                                                     
TLSEngine                  on                                            
TLSLog                     /var/log/proftpd/tls.log                      
TLSProtocol TLSv1.2                                                      
TLSCipherSuite AES128+EECDH:AES128+EDH                                   
TLSOptions                 NoCertRequest AllowClientRenegotiations       
TLSRSACertificateFile      /etc/proftpd/ssl/proftpd.pem             
TLSRSACertificateKeyFile   /etc/proftpd/ssl/proftpd.pem              
TLSVerifyClient            off                                           
TLSRequired                on                                            
RequireValidShell          no                                            
</IfModule> 

我创建了proftpd.pemopenssl req -new -x509 -days 365 -nodes -out /etc/proftpd/ssl/proftpd.pem -keyout /etc/proftpd/ssl/proftpd.pem

一个普通的 FileZilla 可以完美运行,但Require explicit FTP over TLS返回500 AUTH not understood.

编辑 2

默认情况下不编译 mod_tls.c。我proftpd -l能够看到所有模块:

Compiled-in modules:
  mod_core.c
  mod_xfer.c
  mod_rlimit.c
  mod_auth_unix.c
  mod_auth_file.c
  mod_auth.c
  mod_ls.c
  mod_log.c
  mod_site.c
  mod_delay.c
  mod_facts.c
  mod_ident.c
  mod_cap.c

Mod_tls.c 不在列表中,这可能就是它不起作用的原因。如何将 mod_tls.c 添加到 proftpd 列表中?

linux ftp ftps proftpd
  • 1 个回答
  • 195 Views
Martin Hope
geonaut
Asked: 2016-12-16 02:17:37 +0800 CST

使用客户端身份验证证书 (OpenSSL) 调试 curl FTPS 连接

  • 1

(从 StackOverflow 移出)我被要求使用客户端身份验证证书设置 FTPS 连接。我是客户端,连接到服务器。我在防火墙后面的 Windows 7 工作站上,尽管此连接最终将在专用的 CentOS VM 上使用。其他一些信息:

  • 仅 TLS 1.2
  • 仅被动模式
  • 我的 WAN IP 已列入白名单
  • 我现在正在连接到一个测试 URL
  • 没有出站防火墙(只有入站规则)
  • 密钥应以 PEM 格式发送

我从 Comodo 购买了证书,并使用 IE10 生成了证书。我从 IE 导出了完整的证书,带有私钥和扩展属性,格式为 .pfx。

我使用 OpenSSL 编写了一个小批处理文件来从 .pfx 中提取必要的部分:

::Extract the private key from the PFX
openssl pkcs12 -in comodo.pfx -nocerts -out encrypted.key
::Extract unencrypted private key
openssl rsa -in encrypted.key -out decrypted.key
::Extract the public cert in Base64 from the PFX
openssl pkcs12 -in comodo.pfx -clcerts -nokeys | openssl x509 -out comodo.cer
::Extract the chain bundle from the PFX
openssl pkcs12 -in comodo.pfx -nodes -nokeys -cacerts | openssl x509 -out comodo.crt

使用提取的关键部分,我一直在尝试各种 curl (v7.46.0) 命令来连接到 FTPS 服务器。连接不断失败。我的最新尝试如下。错误几乎总是相同的。

curl -3 -k -v --ftp-ssl --tlsv1.2 --ftp-ssl-reqd --ftp-pasv --key decrypted.key --cacert comodo.crt --cert comodo.cer --user REMOVED:REMOVED ftp://ftps.REMOVED/

输出的一个例子是:

> curl -3 -v -k --user REMOVED:REMOVED --ftp-ssl --tlsv1.2 --ftp-ssl-reqd --ftp-skip-pasv-ip --cert comodo.cer --key priv.pem ftp://ftps.REMOVED/
*   Trying REMOVED_IP.
* Connected to ftps.REMOVED (REMOVED_IP) port 21 (#0)
< 220 Service ready for new user.
> AUTH SSL
< 234 Command AUTH okay; starting SSL connection.
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* Unknown SSL protocol error in connection to ftps.REMOVED:21
* Closing connection 0 curl: (35) Unknown SSL protocol error in connection to ftps.REMOVED:21
>pause
Press any key to continue . . .

奇怪的是,如果我连接 FileZilla,我似乎可以通过 TLS 握手,但是当我尝试上传文件时会遇到不同的错误。由于这种联系最终将通过 curl 建立,因此我专注于这种方法。

我已经尝试了一个多星期。服务器管理员已从我的提供商处购买了证书,并且可以毫无问题地连接。我被这个难住了。任何帮助将不胜感激。一般 curl / ftps 调试技巧也将不胜感激。

ftp ssl ftps openssl curl
  • 1 个回答
  • 3669 Views
Martin Hope
JuCachalot
Asked: 2016-12-08 00:56:42 +0800 CST

配置 vsftpd 以使用 FTPS

  • 1

我正在尝试将 vstpd 配置为使用 FTPS。我基本上遵循了这些说明。

我设置了一切并生成了一个完全适合我需要的自签名证书,这个 ftp 是不公开的。

但是当我尝试使用 filezilla 连接到 ftp 服务器时,filezilla 挂在“验证证书”行上,而不是询问我是否信任它。

使用其他 FTP 客户端 (bareFTP),我收到此错误:

Server certificate error: 
RemoteCertificateNameMismatch,
RemoteCertificateChainErrors
Try disabling Server Certificate Validation

如果我按照建议禁用了验证,它会起作用,因此问题不在 vsftpd 配置文件中,而是在我的自签名证书中。

谁能告诉我它有什么问题?我使用这个命令来生成它:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem

在“通用名称(例如,您的姓名)”字段中,我尝试输入服务器 IP 地址和我的公司名称。

vsftpd ftps openssl
  • 1 个回答
  • 925 Views
Martin Hope
s.lenders
Asked: 2016-04-11 00:50:29 +0800 CST

LIST 上的 ProFTPd 超时

  • 2

最近我将一个 centOS 5 服务器迁移到 7。但从那时起,除非我将 FileZilla 放在 FTP 普通连接上,否则通过 FileZilla 连接到 FTP 不起作用。

获取文件夹列表时 TLS 不起作用登录工作正常。但在那之后它超时了。

2016-04-10 11:29:59 3348 1 Status: Resolving address of something.com
2016-04-10 11:29:59 3348 1 Status: Connecting to x.x.x.x:21...
2016-04-10 11:29:59 3348 1 Status: Connection established, waiting for welcome message...
2016-04-10 11:29:59 3348 1 Response: 220 ProFTPD 1.3.5b Server ready.
2016-04-10 11:29:59 3348 1 Command: AUTH TLS
2016-04-10 11:29:59 3348 1 Response: 234 AUTH TLS successful
2016-04-10 11:29:59 3348 1 Status: Initializing TLS...
2016-04-10 11:29:59 3348 1 Status: Verifying certificate...
2016-04-10 11:29:59 3348 1 Status: TLS connection established.
2016-04-10 11:29:59 3348 1 Command: USER xxxxx
2016-04-10 11:29:59 3348 1 Response: 331 Password required for xxxxx
2016-04-10 11:29:59 3348 1 Command: PASS ***********
2016-04-10 11:29:59 3348 1 Response: 230 User xxxxx logged in
2016-04-10 11:29:59 3348 1 Command: OPTS UTF8 ON
2016-04-10 11:29:59 3348 1 Response: 200 UTF8 set to on
2016-04-10 11:29:59 3348 1 Command: PBSZ 0
2016-04-10 11:29:59 3348 1 Response: 200 PBSZ 0 successful
2016-04-10 11:29:59 3348 1 Command: PROT P
2016-04-10 11:29:59 3348 1 Response: 200 Protection set to Private
2016-04-10 11:29:59 3348 1 Status: Logged in
2016-04-10 11:29:59 3348 1 Status: Retrieving directory listing...
2016-04-10 11:29:59 3348 1 Command: PWD
2016-04-10 11:29:59 3348 1 Response: 257 "/" is the current directory
2016-04-10 11:29:59 3348 1 Command: TYPE I
2016-04-10 11:29:59 3348 1 Response: 200 Type set to I
2016-04-10 11:29:59 3348 1 Command: PASV
2016-04-10 11:29:59 3348 1 Response: 227 Entering Passive Mode (x,x,x,x,137,183).
2016-04-10 11:29:59 3348 1 Command: LIST
2016-04-10 11:30:19 3348 1 Error: Connection timed out after 20 seconds of inactivity
2016-04-10 11:30:19 3348 1 Error: Failed to retrieve directory listing
2016-04-10 11:31:41 3348 1 Status: Disconnected from server

到目前为止,我唯一能找到的就是将它添加到 proftpd.conf

  <IfModule mod_facts.c>
    FactsAdvertise off
  </IfModule>

这会将命令更改为 LIST 而不是 MLSD。然而它仍然无缘无故超时。有人有什么主意吗?

编辑:没有 TLS 连接工作正常

2016-04-10 11:21:28 8704 1 Status: Resolving address of something.com
2016-04-10 11:21:28 8704 1 Status: Connecting to x.x.x.x:21...
2016-04-10 11:21:28 8704 1 Status: Connection established, waiting for welcome message...
2016-04-10 11:21:28 8704 1 Response: 220 ProFTPD 1.3.5b Server ready.
2016-04-10 11:21:28 8704 1 Command: USER xxxxx
2016-04-10 11:21:28 8704 1 Response: 331 Password required for xxxxx
2016-04-10 11:21:28 8704 1 Command: PASS ***********
2016-04-10 11:21:28 8704 1 Response: 230 User xxxxxlogged in
2016-04-10 11:21:28 8704 1 Command: SYST
2016-04-10 11:21:28 8704 1 Response: 215 UNIX Type: L8
2016-04-10 11:21:28 8704 1 Command: FEAT
2016-04-10 11:21:28 8704 1 Response: 211-Features:
2016-04-10 11:21:28 8704 1 Response:  LANG en-US*
2016-04-10 11:21:28 8704 1 Response:  EPRT
2016-04-10 11:21:28 8704 1 Response:  EPSV
2016-04-10 11:21:28 8704 1 Response:  MDTM
2016-04-10 11:21:28 8704 1 Response:  SSCN
2016-04-10 11:21:28 8704 1 Response:  SIZE
2016-04-10 11:21:28 8704 1 Response:  PROT
2016-04-10 11:21:28 8704 1 Response:  CCC
2016-04-10 11:21:28 8704 1 Response:  PBSZ
2016-04-10 11:21:28 8704 1 Response:  AUTH TLS
2016-04-10 11:21:28 8704 1 Response:  REST STREAM
2016-04-10 11:21:28 8704 1 Response:  UTF8
2016-04-10 11:21:28 8704 1 Response: 211 End
2016-04-10 11:21:28 8704 1 Command: OPTS UTF8 ON
2016-04-10 11:21:28 8704 1 Response: 200 UTF8 set to on
2016-04-10 11:21:28 8704 1 Status: Logged in
2016-04-10 11:21:28 8704 1 Status: Retrieving directory listing...
2016-04-10 11:21:28 8704 1 Command: PWD
2016-04-10 11:21:28 8704 1 Response: 257 "/" is the current directory
2016-04-10 11:21:28 8704 1 Command: TYPE I
2016-04-10 11:21:28 8704 1 Response: 200 Type set to I
2016-04-10 11:21:28 8704 1 Command: PASV
2016-04-10 11:21:29 8704 1 Response: 227 Entering Passive Mode (x,x,x,x,139,173).
2016-04-10 11:21:29 8704 1 Command: LIST
2016-04-10 11:21:29 8704 1 Response: 150 Opening BINARY mode data connection for file list
2016-04-10 11:21:29 8704 1 Response: 226 Transfer complete
2016-04-10 11:21:29 8704 1 Status: Directory listing of "/" successful
ftps proftpd centos7
  • 1 个回答
  • 4509 Views
Martin Hope
Michael H.
Asked: 2012-06-08 08:52:10 +0800 CST

如何限制连接双方的 FTPS 端口?

  • 0

有没有办法限制连接的服务器端和客户端的 FTPS 端口?

我已经读过这个答案,我已经设置了 vsftpd 以将被动端口的使用限制在服务器端的一个狭窄范围内。我已经验证此限制对服务器有效。但是,如果客户端本身位于防火墙后面并且小心地限制了那一端的访问,则连接会失败。使用 tcpdump 检查,似乎正在使用客户端的任意高端口。

SFTP 不是一个选项。(相信我,我希望如此。)

ftp security ftps
  • 2 个回答
  • 427 Views
Martin Hope
Palantir
Asked: 2012-06-02 06:31:03 +0800 CST

使用 Vsftp 的 FTPS 问题

  • 2

我的Vstpd有一些问题,我不知道它们是否相关。

一个问题是 FireFTP 无法通过目录列表阶段 - 它永远停留在那里,没有错误消息。Filezilla 可以工作,但有时也会卡住。特别是有些文件无法上传——它们也会永远卡住,有时会通过几个字节;这里也没有服务器端的错误消息,只有客户端超时。其他客户端似乎完全不受影响(特别是 Windows 上的 Cyber​​duck 和 Mac 上的 Transmit 始终完美运行)。

使用 FileZilla,我尝试上传的文件将在服务器上以零字节大小创建,但不会上传任何内容。如果文件已经存在,它将被清空。我还可以将其他文件上传到同一目录,所以这不是权限问题。

我的配置有问题吗?我使用的是过时的版本吗?(这是 Ubuntu 10.04)。这是 vsftpd.conf。使用自签名证书。

也许这是一个 Linux 问题???使用 Ubuntu 12.04 作为客户端操作系统。

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
dual_log_enable=YES
xferlog_std_format=NO
xferlog_file=/var/log/vsftpd.log
session_support=YES

connect_from_port_20=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem

ssl_enable=YES
require_ssl_reuse=NO
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=YES
ssl_sslv3=YES
ssl_ciphers=HIGH
ftp vsftpd ftps gnutls
  • 2 个回答
  • 855 Views
Martin Hope
susmits
Asked: 2010-04-11 06:05:40 +0800 CST

FTP 与 SFTP 与 FTPS

  • 10

我们正在工作区设置一个 Web 服务器。同时,我们计划安装一个 FTP 服务器,但是我不知道使用什么协议——FTP、SFTP 或 FTPS。我四处搜索,试图看看什么协议提供什么,遇到这样的文章,但我无法下定决心。只需要简单的、偶尔一次的文件传输;但是,安全性是一个问题,因为文件服务器旨在可从 Internet 访问。

哪种协议最适合我使用,为什么?

ftp sftp ftps
  • 5 个回答
  • 18896 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve