使用vsftpd搭建ftp服务(下)

测试

  • 在Windows上使用FTP服务进行测试,需要安装客户端软件filezilla;

  • 在Linux上使用FTP服务进行测试,需要安装lftp工具 # yum install -y lftp;

[root@dl-001 vsftpd_user_conf]# lftp test1@127.0.0.1

口令: 

lftp test1@127.0.0.1:~> ls          

-rw-r--r--    1 1003     1004            0 Jan 03 01:56 dl.txt

lftp test1@127.0.0.1:/> ?    //查看可以使用的命令

    !<shell-command>                     (commands)

    alias [<name> [<value>]]             attach [PID]

    bookmark [SUBCMD]                    cache [SUBCMD]

    cat [-b] <files>                     cd <rdir>

    chmod [OPTS] mode file...            close [-a]

    [re]cls [opts] [path/][pattern]      debug [<level>|off] [-o <file>]

    du [options] <dirs>                  exit [<code>|bg]

    get [OPTS] <rfile> [-o <lfile>]      glob [OPTS] <cmd> <args>             help [<cmd>]

    history -w file|-r file|-c|-l [cnt]  jobs [-v] [<job_no...>]

    kill all|<job_no>                    lcd <ldir>

    lftp [OPTS] <site>                   ln [-s] <file1> <file2>              ls [<args>]

    mget [OPTS] <files>                  mirror [OPTS] [remote [local]]

    mkdir [-p] <dirs>                    module name [args]                   more <files>

    mput [OPTS] <files>                  mrm <files>

    mv <file1> <file2>                   [re]nlist [<args>]

    open [OPTS] <site>                   pget [OPTS] <rfile> [-o <lfile>]

    put [OPTS] <lfile> [-o <rfile>]      pwd [-p]

    queue [OPTS] [<cmd>]                 quote <cmd>

    repeat [OPTS] [delay] [command]      rm [-r] [-f] <files>

    rmdir [-f] <dirs>                    scache [<session_no>]

    set [OPT] [<var> [<val>]]            site <site-cmd>                      source <file>

    torrent [-O <dir>] <file|URL>...     user <user|URL> [<pass>]

    wait [<jobno>]                       zcat <files>                         zmore <files>

方法1 使用xshell实现FTP的功能

  • 新建会话,注意协议为SFTP
    QQ截图20180103111346.png

  • 输入用户名
    QQ截图20180103111227.png

  • 输入密码
    QQ截图20180103111238.png

登录成功
sftp:/root> ls    //使用SFTP协议登录成功

dr-xr-x---   10 root     root         4096 Jan  3 10:53 .

dr-xr-xr-x   20 root     root          256 Dec 14 22:33 ..

-rw-r--r--    1 root     root           18 Dec 29  2013 .bash_logout

-rw-r--r--    1 root     root          176 Dec 29  2013 .bash_profile

-rw-r--r--    1 root     root          176 Dec 29  2013 .bashrc

-rw-r--r--    1 root     root          100 Dec 29  2013 .cshrc

-rw-r--r--    1 root     root          129 Dec 29  2013 .tcshrc

-rw-------    1 root     root         5570 Oct 23 10:52 anaconda-ks.cfg

drwx------    2 root     root           48 Dec  6 19:07 .ssh

-rw-------    1 root     root        25194 Jan  3 01:12 .bash_history

-rw-r--r--    1 root     root            0 Oct 24 09:10 2.txt

-rw-------    1 root     root           55 Oct 24 09:51 .lesshst

drwxr-sr-x    2 user1    root           62 Dec  6 20:54 dir

drwxr-xr-x    2 root     root           30 Oct 26 22:55 222

drwxr-xr-x    2 root     root           21 Oct 26 23:20 dd

-rwx------    2 root     root           50 Oct 27 14:08 1.txt

-rwx------    2 root     root           50 Oct 27 14:08 1_heard.txt

lrwxrwxrwx    1 root     root            5 Oct 27 08:59 1_sorft.txt

drwxr-sr-x    2 user1    root           32 Oct 26 23:18 root@192.168.111.127

-rw-r--r--    1 root     root          395 Dec 17 22:30 1q

drwxr-----    3 root     root           19 Dec 18 20:17 .pki

-rw-------    1 root     root         2446 Dec 31 22:07 .mysql_history

-rw-r--r--    1 root     root           16 Dec 28 15:17 exit

drwxr-xr-x    3 root     root           19 Jan  3 10:20 .local

drwxr-xr-x    3 root     root           18 Jan  3 10:20 .config

-rw-------    1 root     root         7819 Jan  3 10:53 .viminfo

  • 设定sftp工具下载的文件存放位置
    QQ截图20180103112124.png

QQ截图20180103112200.png

设置完本地路径之后

在Linux中

sftp:/root> get 1.txt

Fetching /root/1.txt to 1.txt

sftp: received 50 ؖ½ؠin 0.05 seconds

在本地即可查看到传输的文件。


方法2使用xftp

在xshell中退出当前会话的状态下使用组合键:Ctrl+Alt+f 下载xftp插件,出现如下所示内容

QQ截图20180103112821.png

说明:单击下载,根据提示安装xftp插件


单击跳转到此页面

这里写图片描述


说明已经发送到邮箱了,到邮箱查看下载地址

这里写图片描述


在你的邮箱里,点击此页面

这里写图片描述


点击此处下载

这里写图片描述

说明:下载完之后直接安装;在dl-02-sftp会话登录的状态下,Ctrl+Alt+f 启动Xftp


启动Xftp连接状态界面如下:

这里写图片描述
说明:左边为桌面,右边为虚拟机的/root目录


停掉21端口
[root@dl-001 ~]# systemctl stop vsftpd

说明:此时就可以传输文件了!!!!


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值