ftp文件服务器客户端,ftp文件服务器客户端访问及常用命令

2023-05-16

FTP是一个C/S类型的软件,连接服务端需要FTP客户端才能完成,常见的FTP客户端有以下几种:

浏览器:可以通过浏览器中输入 ftp://ip或者ftp://域名的方式3分钟了解计算机发展历史-组团学来访问FTP

自带客户端:命令行下可以使用ftp命令去连接

三方客户端:FileZilla 8uftp 图形软件或者文本界面的lftp等

三种方式中,文本界面是比较麻烦的,无法鼠标流。所以我重点给大家讲解一下

1)文本界面登陆

文本界面匿名登陆

[root@localhost ~]# ftp 192.168.11.16

Connected to 192.168.11.16 (192.168.11.16).

220 (vsFTPd 3.0.3)

Name (192.168.11.16:root): ftp #用户名可以是ftp也可以是anonymous

331 Please specify the password.

Password: #密码为空

230 Login successful. #显示登陆成功

Remote system type is UNIX.

Using binary mode to transfer files.

ftp> ls

227 Entering Passive Mode (192,168,11,16,90,35).

150 Here comes the directory listing.

drwxr-xr-x    2 0        0               6 May 14  2019 pub

226 Directory send OK.

通过ls可以列出当前目录下有哪些内容 看到有一个目录叫pub

ftp> pwd

257 "/"

通过pwd命令查看当前路径  注意这里显示的是FTP的根目录

ftp> bye

221 Goodbye.

退出使用bye命令

文本界面本地用户登录

[root@localhost ~]# ftp 192.168.11.16

Connected to 192.168.11.16 (192.168.11.16).

220 (vsFTPd 3.0.3)

Name (192.168.11.16:root): hello

331 Please specify the password.

Password:

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp> ls

227 Entering Passive Mode (192,168,11,16,130,240).

150 Here comes the directory listing.

drwxr-xr-x    2 1001     1001            6 Jan 15 08:56 下载

drwxr-xr-x    2 1001     1001            6 Jan 15 08:56 公共

drwxr-xr-x    2 1001     1001            6 Jan 15 08:56 图片

drwxr-xr-x    2 1001     1001            6 Jan 15 08:56 文档

drwxr-xr-x    2 1001     1001            6 Jan 15 08:56 桌面

drwxr-xr-x    2 1001     1001            6 Jan 15 08:56 模板

drwxr-xr-x    2 1001     1001            6 Jan 15 08:56 视频

drwxr-xr-x    2 1001     1001            6 Jan 15 08:56 音乐

226 Directory send OK.

ftp> pwd

257 "/home/hello" is the current directory

2)FTP客户端常用命令

键入help命令可以查看所有可使用的命令

ftp> help

Commands may be abbreviated.  Commands are:

!                debug         mdir           sendport     site

$                dir           mget           put          size

account          disconnect    mkdir          pwd          status

append           exit          mls            quit         struct

ascii            form          mode           quote        system

bell             get           modtime        recv         sunique

binary           glob          mput           reget        tenex

bye              hash          newer          rstatus      tick

case             help          nmap           rhelp        trace

cd               idle          nlist          rename       type

cdup             image         ntrans         reset        user

chmod            lcd           open           restart      umask

close            ls            prompt         rmdir        verbose

cr               macdef        passive        runique        ?

delete           mdelete       proxy          send

!+linux命令   执行系统命令

!ls /opt  显示linux系统中/opt目录下的内容

ftp> !ls /opt

dhcp  dns  rh

lcd linux系统中的当前目录

lcd /root  将linux系统中的当前目录切换到/root下

ftp> lcd /root

Local directory now /root

put 上传命令,mput批量上传命令

上传initial-setup-ks.cfg文件到hello家目录下

ftp> put initial-setup-ks.cfg

local: initial-setup-ks.cfg remote: initial-setup-ks.cfg

227 Entering Passive Mode (192,168,11,16,96,132).

150 Ok to send data.

226 Transfer complete.

1803 bytes sent in 0.00135 secs (1333.58 Kbytes/sec)

可以看到上传成功了

验证一下上传结果

ftp> ls

227 Entering Passive Mode (192,168,11,16,173,142).

150 Here comes the directory listing.

-rw-r--r--    1 1000     1000         1803 Feb 26 07:01 initial-setup-ks.cfg

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 下载

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 公共

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 图片

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 文档

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 桌面

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 模板

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 视频

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 音乐

226 Directory send OK.

看见了吧

切换linux当前目录到/tmp

ftp> lcd /tmp

Local directory now /tmp

get下载命令,mget批量下载

下载initial-setup-ks.cfg到linux系统当前目录/tmp

ftp> get initial-setup-ks.cfg

local: initial-setup-ks.cfg remote: initial-setup-ks.cfg

227 Entering Passive Mode (192,168,11,16,229,134).

150 Opening BINARY mode data connection for initial-setup-ks.cfg (1803 bytes).

226 Transfer complete.

1803 bytes received in 2.9e-05 secs (62172.41 Kbytes/sec)

列出linux目录/tmp的内容,看到了下载的文件initial-setup-ks.cfg

ftp> !ls /tmp/

dhcp                                          tracker-extract-files.0

initial-setup-ks.cfg                                  VMwareDnD

systemd-private-8e7a99ea89c14ab396d66116970fe04d-chronyd.service-sghHHs       vmware-root

systemd-private-8e7a99ea89c14ab396d66116970fe04d-colord.service-wK7h08      yum_save_tx.2019-02-20.16-10.Z6uXqR.yumtx

systemd-private-8e7a99ea89c14ab396d66116970fe04d-cups.service-cokBro          yum_save_tx.2019-02-21.09-03.08zIbU.yumtx

systemd-private-8e7a99ea89c14ab396d66116970fe04d-rtkit-daemon.service-6wt1S0  yum_save_tx.2019-02-22.11-10.prawAT.yumtx

ftp> close

221 Goodbye.

ftp> ls

Not connected.

可以使用close断开连接,当连接断开希望再次连接直接使用open命令即可

ftp> open 192.168.11.16

Connected to 192.168.11.16 (192.168.11.16).

220 (vsFTPd 3.0.2)

Name (192.168.11.16:root): hello

331 Please specify the password.

Password:

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp> ls

227 Entering Passive Mode (192,168,11,16,192,88).

150 Here comes the directory listing.

-rw-r--r--    1 1000     1000         1803 Feb 26 07:01 initial-setup-ks.cfg

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 下载

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 公共

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 图片

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 文档

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 桌面

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 模板

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 视频

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 音乐

226 Directory send OK.

delete命令可以删除属于自己的文件

删除initial-setup-ks.cfg文件

ftp> delete initial-setup-ks.cfg

250 Delete operation successful.

ftp> ls

227 Entering Passive Mode (192,168,11,16,168,142).

150 Here comes the directory listing.

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 下载

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 公共

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 图片

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 文档

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 桌面

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 模板

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 视频

drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 音乐

226 Directory send OK.

总结

都有哪些方法可以连接ftp服务器

文本方式如何连接

在文本界面中有哪些操作

重点:如何使用ftp命令在文本界面下连接ftp服务器

难点:区分清楚何时操作的是ftp服务器的内容,何时操作的是本地的内容

版权申明:本站文章均来自网络,如有侵权,请联系01056159998 邮箱:itboby@foxmail.com

特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ftp文件服务器客户端,ftp文件服务器客户端访问及常用命令 的相关文章

  • PHP curl FTPes w/显式 TLS/SSL

    我一直在尝试使用显式 TLS SSL 服务器推送到远程 FTP 但连接始终超时 它正在连接 但我不知道它在哪里停止 但我假设它与 FTP TLS SSL 控制通道有关 任何帮助将不胜感激 通过 FileZilla 我可以毫无问题地进行连接
  • Ftp 仅在 .NET 4.0 中抛出 WebException

    我有以下 C 代码 当针对 NET Framework 3 5 或 2 0 编译时 它运行得很好 我没有针对 3 0 进行测试 但它很可能也能工作 问题是 当针对 NET Framework 4 0 构建时它会失败 FtpWebReques
  • 让 FTP 在 Azure VM 上运行,克服 ftp 客户端上的“连接关闭”问题

    我正在努力连接到 Azure 中新 VM 上的 FTP 我从默认映像 Windows Server 2012 Datacenter 创建了一个新的虚拟机 并通过 RDP 连接到新的虚拟机中 然后 我启用了 Web 服务器 IIS 角色 包括
  • 如何在 C# 中将字符串数据作为 ZIP 存档上传到 FTP 服务器

    这是我的代码 我想导出 上传这个 dat文件以 zip 格式传输到 FTP 服务器 我尝试了很多但没有找到任何解决方案 任何人都可以帮助我解决这个问题 public string ExportVoid FileSetups fileSetu
  • ftp 在 java 中无法正确下载文件?

    当我使用以下代码下载文件时 它只是将文件写入本地目的地 但文件大小均为零 有人能说为什么会发生这种情况以及如何解决它吗 import org apache commons net ftp FTPClient import org apach
  • git-ftp 在 repo 根目录中的文件夹和文件名中添加尖号 (#)

    I use Git ftp https github com git ftp git ftp scripts to uploading of my project via FTP on shared hosting But there is
  • FTP 对 PASV 命令的响应应该是什么

    我正在编写一个 FTP 服务器 但我不理解 PASV 命令 任何服务器都会发送如下响应 227 Entering Passive Mode 213 229 112 130 216 4 括号里的数字是什么意思 普通模式和被动模式有什么区别 是
  • 如何使用 php 检查 smtp 服务器是否正常工作

    我想使用 php 检查我的网站 smtp 是关闭还是开启 我尝试使用 fsockopen 连接到服务器上的端口 25 然后当 smtp 服务运行时它返回 true 这是使用 php 脚本测试 smtp 或 ftp 是否运行的最佳方法 您正在
  • FTP 传入监控(上传时)

    我们有大约 100 个用户通过 FTP 登录并上传文件 我们的在线系统 PHP 应该显示刚刚上传的项目 我不想继续检查所有不同的 FTP 文件夹来检查新文件 在不降低服务器速度的情况下 使用 PHP 检查新文件的最佳方法是什么 所有用户都在
  • 在 FTP 上上传多个文件

    我是 Objective C 和 iOS 的新手 我正在使用 SimpleFTPSample 制作用于将文件上传和下载到 ftp 的测试应用程序 我需要在 ftp 上上传两个文件 但在 SimpleFTPSample 中您只能上传一个 那么
  • 使用.net 2.0 连接到 FTP 服务器 [关闭]

    Closed 此问题正在寻求书籍 工具 软件库等的推荐 不满足堆栈溢出指南 help closed questions 目前不接受答案 我希望连接到现有的 FTP 服务器 上传文件 等待服务器生成报告 然后将该报告下载回 VB NET 2
  • Java:从 FTP 服务器访问文件

    我有一个 FTP 服务器 里面有一堆文件夹和文件 我的程序需要访问该服务器 读取所有文件并显示它们的数据 出于开发目的 我一直在使用硬盘驱动器上 src 文件夹中的文件 但现在服务器已启动并运行 我需要将软件连接到它 基本上我想要做的是获取
  • 从 C# 中的服务器下载后,Zip 文件被损坏

    request MakeConnection uri WebRequestMethods Ftp DownloadFile username password response FtpWebResponse request GetRespo
  • php ftp 检查文件夹是否存在总是返回创建文件夹错误

    有人可以告诉我这段代码中做错了什么吗 if id if is dir public html tem pasta path pics id echo pasta j existia destination file public html
  • PHP 通过 FTP 下载整个文件夹(递归)

    我目前有一个非常大的网站 大小约为 5GB 包含 60 000 个文件 当前主机并没有做太多事情来帮助我将网站转移到新主机 我的想法是在新主机上制作一个简单的脚本 通过 FTP 传输到旧主机并下载整个 public html 文件夹 递归地
  • 通过 FTP over TLS/SSL 连接到未经认证的主机

    我从中获取文件的供应商正在从 FTP 更改为基于 SSL 的 FTP 我正在尝试更新我的代码net ftp to net ftptls 我需要连接的新主机未经认证 我的脚本报告此错误 主机名与服务器证书不匹配 供应商不会修复此问题 看着 u
  • Indy FTP 传输类型

    我正在使用 IdFTP Indy 10 组件从远程位置下载一些文件 zip 和 txt 在获取每个文件之前 我将 TransferType 设置为二进制 IdFTP TransferType ftBinary IdFTP Get ASour
  • 使用 Python ftplib 获取远程 FTP 服务器中文件的 MD5 值

    使用 ftplib 将文件传输到服务器后 如何确定该文件与本地服务器中的文件的 MD5 from ftplib import FTP import hashlib ftp FTP server ftp login username pass
  • 服务器响应 PASV 命令返回的地址与建立 FTP 连接的地址不同

    System Net WebException 服务器响应 PASV 命令返回的地址与建立 FTP 连接的地址不同 在 System Net FtpWebRequest CheckError 在 System Net FtpWebReque
  • JSch中如何设置文件类型和文件传输模式?

    我使用 Apache Common NetFTPClient并设置了我的ftpClient在上传文件之前使用如下所示的方法 ftpClient setFileType FTP BINARY FILE TYPE ftpClient setFi

随机推荐