最近需要使用 ftp 工具,所以借此机会来进行整理以下具体的内容:

具体什么是ftp, ftp 能干什么?

请参考:

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/s1-ftp

http://cn.linux.vbird.org/linux_server/0410vsftpd.php

重点理解:主动联机 与 被动联机 两种模式中,端口的选择。

主动连接

active mode

       Active mode is the original method used by the FTP protocol for transferring data to the client application. When an active-mode data transfer is initiated by the FTP client, the server opens a connection from port 20 on the server to the IP address and a random, unprivileged port (greater than 1024) specified by the client. This arrangement means that the client machine must be allowed to accept connections over any port above 1024. With the growth of insecure networks, such as the Internet, the use of firewalls for protecting client machines is now prevalent. Because these client-side firewalls often deny incoming connections from active-mode FTP servers, passive mode was devised.

被动连接

passive mode

       Passive mode, like active mode, is initiated by the FTP client application. When requesting data from the server, the FTP client indicates it wants to access the data in passive mode and the server provides the IP address and a random, unprivileged port (greater than 1024) on the server. The client then connects to that port on the server to download the requested information.
       While passive mode does resolve issues for client-side firewall interference with data connections, it can complicate administration of the server-side firewall. You can reduce the number of open ports on a server by limiting the range of unprivileged ports on the FTP server. This also simplifies the process of configuring firewall rules for the server.
 
安装vsftpd 软件:
➜  Desktop yum search vsftpd
Last metadata expiration check: days, :: ago on Tue Jun :: PM CST.
================================================== Name Exactly Matched: vsftpd ==================================================
vsftpd.x86_64 : Very Secure Ftp Daemon

vsftpd 全称为:  Very Secure Ftp Daemon

vsftpd 配置文件:我们可以使用 man 5 vsftpd.conf 命令,来查找vsftpd 的配置说明。

FTP 连接与命令:

1. 登录

[root@dhcp-- ~]# ftp localhost
Trying ::...
Connected to localhost (::).
Welcome to blah FTP service.
Name (localhost:root): yaowen
Please specify the password.
Password:
Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
Entering Extended Passive Mode (||||)
Here comes the directory listing.
drwxr-xr-x Jun : Desktop
drwxr-xr-x Jun Documents
drwxr-xr-x May : Downloads
drwxrwxr-x Jun : ISO
drwxr-xr-x Jun : NFS4
drwxr-xr-x Jun Pictures
drwxr-xr-x Jun Public
drwxr-xr-x Jun Templates
drwxr-xr-x Jun Videos
Directory send OK.
ftp>

2. 如果没有ftp 命令,则进行安装

[root@yaowenxu Desktop]# yum install ftp

3. ftp 支持的命令

使用 help 或者 ? 来进行查看当前服务所支持的命令

ftp> ?
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

我们可以使用 ftp 利用交互式的方式来进行与 ftpd 服务器来进行交互。

我们 可以使用 get 下载文件,使用 put 上传文件;

使用 lcd 确定本地文件夹,使用pwd 确定服务器文件夹。

保持更新,转载请注明出处。

FTP 命令的使用的更多相关文章

  1. linux系统ftp命令

    先来一段简单的ftp 下载脚本 ftp -i -n<<EOF open 14.2.33.211 user etl etl cd /etlfile/ftpfile lcd /etlfile/ ...

  2. Linux服务器ftp命令找不到

    ftp commond not find 先用命令rpm -q vsftpd检查是否安装了ftp服务器 若显示vsftpd-2.2.2-11.el6_4.1.x86_64这样的信息,说明FTP服务器已 ...

  3. FTP命令

    linux下常用FTP命令 1. 连接ftp服务器   1. 连接ftp服务器 格式:ftp [hostname| ip-address]a)在linux命令行下输入: ftp 192.168.1.1 ...

  4. windows下ftp命令大全

    FTP Server: home4u.at.china.com User: yepanghuang Password: abc123 打开Windows的开始菜单,执行“运行”命令,在对话框中输入ft ...

  5. 通过FTP命令上传下载

      用命令如何把自己电脑上的文件上传到被入侵的电脑上呢.方法有很多.用ftp是个不错的选择.方法如下 echo open 你的ftpip >ftp.txt echo user >>f ...

  6. linux ftp命令(转)

    此命令需要安装ftp, yum install ftp 1. 连接ftp服务器 格式:ftp [hostname| ip-address]a)在linux命令行下输入: ftp 192.168.1.1 ...

  7. 详述Linux ftp命令的使用方法

    转自:http://os.51cto.com/art/201003/186325.htm ftp服务器在网上较为常见,Linux ftp命令的功能是用命令的方式来控制在本地机和远程机之间传送文件,这里 ...

  8. 利用windows系统ftp命令编写的BAT文件上传[转]

    利用windows系统ftp命令编写的BAT文件上传[转] 利用windows系统ftp命令编写的BAT文件上传[转] 在开发中往往需要将本地的程序上传到服务器,而且用惯了linux命令的人来说.在w ...

  9. ftp命令和scp命令

    ftp命令: 服务器有安装ftp Server,另外一台linux可以使用ftp的client程序来进行文件的拷贝读取和下载. 1. 连接ftp服务器  格式:ftp [hostname| ip-ad ...

  10. FTP命令详解

    FTP的命令行格式为:ftp -v -d -i -n -g [主机IP或者主机名],其中 -v显示远程服务器的所有响应信息: -n限制ftp的自动登录,即不使用: .n etrc文件: -d使用调试方 ...

随机推荐

  1. How to check Logstash's pulse

    Have you ever wondered if Logstash was sending data to your outputs? There's a brand new way to chec ...

  2. java设计模式(详)

    http://www.runoob.com/design-pattern/design-pattern-tutorial.html

  3. C++语言------顺序表实现,用动态数组的方法

    C++ 中常用的一些东西,通过使用动态数组来实现顺序表, 掌握了一下知识点: 1.预处理有三中方法 宏定义,文件包含,条件编译 2.使用同名的变量时,可以在外层使用命名空间 类解决变量名重定义的错误 ...

  4. 4.3.6 对象的界定通过编写接口来访问带这类命名结构的表会出问题。如前所述,SQL Server的灵活性不应用作编写错误代码或创建问题对象的借口。 注意在使用Management Studio的脚本工具时,SQL Server会界定所有的对象。这不是因为这么做是必须的,也不是编写代码的最佳方式,而是因为在界定符中封装所有的对象,比编写脚本引擎来查找需要界定的对象更容易。

    如前所述,在创建对象时,最好避免使用内嵌的空格或保留字作为对象名,但设计人员可能并没有遵守这个最佳实践原则.例如,我当前使用的数据库中有一个审核表名为Transaction,但是Transaction ...

  5. 如何修改eclipse中maven默认仓库路径

    从eclipse中增加了maven2的插件之后,maven默认的本地库的路径是${user}/.m2/repository/下,一般windows用户的操作系统都安装在C盘,所以这个目录下的jar包比 ...

  6. [PHP] 排序和查找算法

    知乎:冒泡排序(bubble sort)的原理是什么? 潘屹峰: 冒泡排序的原理可以顾名思义:把每个数据看成一个气泡,按初始顺序自底向上依次对两两气泡进行比较,对上重下轻的气泡交换顺序(这里用气泡轻. ...

  7. Java多线程--JDK并发包(1)

    Java多线程--JDK并发包(1) 之前介绍了synchronized关键字,它决定了额一个线程是否可以进入临界区:还有Object类的wait()和notify()方法,起到线程等待和唤醒作用.s ...

  8. 批处理REG学习

    首先在批处理操作注册表之前,应该了解REG命令的使用方式,详情请参阅一下网址: https://www.jb51.net/article/30078.htm 从以上链接内容我们可以详细了解使用reg的 ...

  9. Navicat相关应用及注意事项

    一.MySQL数据类型 1.数值型 SMALLINT: 2个字节 INT: 4个字节      // age int(10) INTEGER:INT的同义词 BIGINT : 8个字节 FLOAT : ...

  10. SpringMVC拦截器和@ResponseBody注解冲突

    在使用@ResponseBody注解后controller方法只会返回ModelandView对象的数据模型,不会返回视图,这样有很多好处,但是如果在拦截器中进行了页面转发,在满足页面转发条件时,不会 ...