sftp ftp ftps_Ftp,Http,Sftp,Https,Ftps,Fish PotocolsLinux Lftp客户端教程

sftp ftp ftps

sftp ftp ftps

Lftp is a powerful command line tool which supports FTP, HTTP, SFTP, FISH, TORRENT protocols for file and data transfer. As we can see it supports popular data and file transfer protocols. It uses GNU TLS or OpenSSL for SSL/TLS encryption. In this tutorial we will look installing and different examples with lftp .

Lftp是功能强大的命令行工具,支持FTP,HTTP,SFTP,FISH,TORRENT协议进行文件和数据传输。 如我们所见,它支持流行的数据和文件传输协议。 它使用GNU TLS或OpenSSL进行SSL / TLS加密。 在本教程中,我们将介绍lftp安装和其他示例。

安装 (Install)

lftp  is provided Linux distributions from official repositories. We can install it for yum  based distros like Fedora, RedHAT, CentOS with the following command.

lftp是从官方存储库提供Linux发行版。 我们可以使用以下命令将其安装在基于yum的发行版中,例如Fedora,RedHAT,CentOS。

$ sudo yum install lftp -y

another alternative is installing it into apt based distros like Debian, Ubuntu, Kali, Mint.

另一种选择是将其安装到基于apt的发行版中,例如Debian,Ubuntu,Kali,Mint。

$ sudo yum install lftp -y

语法和帮助 (Syntax and Help)

lftp provides very simple syntax. We can show syntax and help information with the -h option like below.

lftp提供了非常简单的语法。 我们可以使用-h选项显示语法和帮助信息,如下所示。

$ lftp -h
Syntax and Help
Syntax and Help
语法和帮助

配置文件(Configuration File)

lftp tool have very detailed configuration file. This configuration file can be used for specify alias, ssl configuration, proxy configuration, anonymous password, etc. Default path and name of the configuration file is /etc/lftp.conf. We can print this configuration file like below. In order to edit this file we need root privileges.

lftp工具有非常详细的配置文件。 该配置文件可用于指定别名,ssl配置,代理配置,匿名密码等。配置文件的默认路径和名称为/etc/lftp.conf 。 我们可以像下面那样打印此配置文件。 为了编辑此文件,我们需要root特权。

$ cat /etc/lftp.conf
Configuration File
Configuration File
配置文件

互动壳(Interactive Shell)

lftp  also provides an interactive shell like FTP connections. We just need to issue the lftp  command where we will enter to the interactive shell.

lftp还提供了交互式外壳,例如FTP连接。 我们只需要发出lftp命令即可进入交互式shell。

$ lftp
Interactive Shell
Interactive Shell
互动壳

连接FTP(Connect FTP)

Now we can start the action. We will connect to an FTP server with the lftp  command. We just need to specify the protocol which is FTP in this case and the IP address or host name of the server. In this example we will connect to ftp.metu.edu.tr .

现在我们可以开始行动了。 我们将使用lftp命令连接到FTP服务器。 在这种情况下,我们只需要指定FTP协议和服务器的IP地址或主机名即可。 在此示例中,我们将连接到ftp.metu.edu.tr

$ lftp ftp://ftp.metu.edu.tr
Connect FTP
Connect FTP
连接FTP

连接SFTP (Connect SFTP)

Another supported protocol is SFTP. SFTP is very similar with the FTP protocol. But the S makes the SFTP secure which means the network traffic is encrytpted with SSL/TLS. Other things are the same with FTP. In this example we will connect using sftp:// of IP address 192.168.1.1 .

另一个受支持的协议是SFTP。 SFTP与FTP协议非常相似。 但是S使SFTP安全,这意味着SSL / TLS加密了网络流量。 其他与FTP相同。 在此示例中,我们将使用IP地址为192.168.1.1的sftp://进行连接。

$ lftp sftp://192.168.1.1

禁用SSL认证验证 (Disable SSL Certification Verification)

There are a lot of configuration about lftp  . One of the most error prone configuration is SSL and SSL verification. As we know SSL certificates are approved by the authorities. But in some cases servers can use unapproved certificates. This will create following error.

关于lftp有很多配置。 SSL和SSL验证是最容易出错的配置之一。 我们知道SSL证书是由当局批准的。 但是在某些情况下,服务器可以使用未经批准的证书。 这将产生以下错误。

Fatal error: Certificate verification: Not trusted

In order to prevent this connection error we need to turn of the SSL certificate verify. Following configuration line will disable SSL verification. This configuration line can be put into global configuration file /etc/lftp.conf  or into user local configuration file ~/.lftp/rc

为了防止此连接错误,我们需要打开SSL证书验证。 以下配置行将禁用SSL验证。 该配置行可以放入全局配置文件/etc/lftp.conf或用户本地配置文件~/.lftp/rc

set ssl:verify-certificate no

代理配置 (Proxy Configuration)

In corporate environment proxy is popular connection technology. In this case we need to specify the proxy configuration to the lftp . We will set proxy configuration by using bash environment variables. We can set HTTP proxy like below. This line should be put into global configuration file /etc/lftp.conf  or user local configuration file /~/.lftp/rc .

在公司环境中,代理是流行的连接技术。 在这种情况下,我们需要为lftp指定代理配置。 我们将使用bash环境变量来设置代理配置。 我们可以像下面这样设置HTTP代理。 该行应放在全局配置文件/etc/lftp.conf或用户本地配置文件/~/.lftp/rc

set http:proxy 192.168.1.1:8080
LEARN MORE  How To Download, Install, and Configure XAMP To Create A Webpage?
了解更多信息如何下载,安装和配置XAMP以创建网页?

翻译自: https://www.poftut.com/linux-lftp-client-tutorial-ftp-http-sftp-https-ftps-fish-potocols/

sftp ftp ftps

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值