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文件服务器客户端访问及常用命令 的相关文章

  • FTP 二进制 x ASCII 自动选择

    我编写了一个 FTP 插件 使用 python 的 ftplib 我想知道确定给定文件是否应该使用二进制或 ASCII 传输方法的最佳方法是什么 换句话说 自动 传输模式 当我收到有关双线的问题报告时 我开始研究这个问题 并且谷歌搜索发现二
  • 使用PHP通过FTP递归扫描目录和子目录

    我正在尝试创建目录中所有文件 及其大小 的列表 包括子目录中的所有内容 这些文件位于远程服务器上 所以我的脚本通过 FTP 连接 然后使用以下命令运行递归函数ftp chdir浏览每个目录 如果有其他方法可以做到这一点 我愿意接受建议 fl
  • php ftp 检查文件夹是否存在总是返回创建文件夹错误

    有人可以告诉我这段代码中做错了什么吗 if id if is dir public html tem pasta path pics id echo pasta j existia destination file public html
  • 如何使用java按上次更新时间对SFTP文件进行排序?

    I am having a set of text files in my FTP server 我想阅读今天之前上传的所有文件 其中我必须打印最后三个上传文件的属性 名称 上传时间 大小 现在我将能够打印 FTP 服务器中存在的文件的名称
  • 如何通过 Python 的请求使用 FTP

    是否可以使用requests与 FTP 站点交互的模块 requests获取 HTTP 页面非常方便 但当我尝试使用 FTP 站点时 我似乎遇到架构错误 我有什么遗漏的吗requests允许我执行 FTP 请求 还是不支持 对于像我一样得到
  • 使用 FtpWebRequest 将文件上传到 FTP 时,远程服务器返回错误:(550)

    I need to upload file via ftp to host The home2 travele2 path created on the root of host 我可以通过 FileZilla 程序将文件上传到主机 但是当
  • 通过 FTP over TLS/SSL 连接到未经认证的主机

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

    我试图使用 PHP 的 ftp connect 函数连接 ftp 服务器 如下所示 但它返回这个错误 警告 ftp connect function ftp connect php network getaddresses getaddri
  • 如何保持 Subversion 和远程服务器(通过 FTP)同步?

    我们很难保持 Subversion 和 FTP 同步 有时我们忘记提交更改并只是将它们推送到 Web 服务器 我们的 svn 文件夹分散在整个 Web 服务器中 有些东西存在于一个地方而不存在于另一个地方 等等 今天我想花点时间解决这个问题
  • 是否可以使用 GitHub Action 和 GitHub FTP Deploy 将 Laravel Web 应用程序部署到共享托管?

    是否可以deploy the Laravel网络应用程序到共享主机使用 GitHub Action 和 GitHub FTP 部署 如果可能的话我应该如何更改 github workflows master yml on push bran
  • GnuTLS 错误 -110:TLS 连接未正确终止

    我发现我的一个 Windows 服务没有连接到 Unix 服务器上的 FTP 位置 我在我的 PC 上运行了可执行文件 因为开发人员没有记录任何错误 并且我在尝试从 FTPWebRequest 获取响应时遇到超时错误C 中的对象 尝试使用
  • 异步回调到BackgroundWorker

    我想使用 NET FTP 库 http netftp codeplex com http netftp codeplex com 该库提供 BeginOpenRead string AsyncCallback object 使用异步编程模型
  • 使用ftp协议连接密码包含“@”符号的服务器

    我正在尝试使用java中的FTP协议从服务器下载文件 通过使用以下 URL 我可以连接到服务器并下载文件 URL url new URL ftp user password host remoteFile type i 但是当我的密码包含
  • 检查 FTP 文件夹是否存在任何与掩码匹配的文件的批处理文件

    我需要创建一个批处理文件来访问受保护的 FTP 站点 检查文件类型 txt 存在 如果存在则进行下一步 如果不存在则返回0并结束作业 我进行了广泛的搜索 但找不到任何解决方案 这不是一项简单的任务 特别是当您需要检查与掩码匹配的文件 而不是
  • 在python中浏览ftp目录

    我正在尝试使用 ftplib 使用 Python 3 从 ftp 服务器下载多个文件夹 我有一个文件夹名称列表 它们都位于文件夹 root 中 问题是我不知道如何浏览它们 当我使用cwd我可以进入更深的目录 但是如何再次起来呢 我正在尝试得
  • 主动\被动模式下 FTP 服务器的适当 iptables 规则

    我在 CentOS6 上安装了 ProFTPD 服务器 如果我使 ftp 本地主机 我可以正确连接 但如果我从外部尝试 我会收到消息 没有到主机的路由 但有一条到主机的路由 因为我是通过 SSH 连接的 我尝试添加以下 iptable 规则
  • 用于 FTP 的文件系统观察器

    我怎样才能实现FileSystemWatcherFTP 位置 在 C 中 这个想法是 每当 FTP 位置添加任何内容时 我都希望将其复制到我的本地计算机 任何想法都会有所帮助 这是我之前问题的后续使用 NET 进行选择性 FTP 下载 ht
  • Jenkins - 如何将文件夹/文件从 Jenkins Linux 代理部署到 Windows 服务器?

    构建完成后 我将得到包含文件的构建文件夹 我需要将它们复制到远程 Windows 服务器 我尝试使用 通过 FTP 发布 插件但似乎 该插件可供采用 因此 根据公司政策 无法安装此功能 https plugins jenkins io pu
  • 备份并上传到FTP服务器[关闭]

    Closed 这个问题正在寻求书籍 工具 软件库等的推荐 不满足堆栈溢出指南 help closed questions 目前不接受答案 谁能指导我一个脚本解决方案来备份目录并将其上传到 ftp 服务器 我最初正在寻找批处理脚本 但任何解决
  • 获取 FTP 服务器上的文件大小并将其放在标签上

    我正在尝试获取托管在FTP服务器并将其放入Label而 BackgroundWorker 在后台工作 我在用着 Try 来获取该值 但是该值在第一次尝试时被捕获 下载后 如果我按尝试再次获取它 那么它就可以工作 Note 第一次尝试时进度条

随机推荐