ftp服务

ftp有两个端口(21是控制端口,20数据端口),有两种工作模式:1.端口模式/主动模式   2.被动模式

客户端决定服务器

 

telnet测试

1.先安装 yum install telnet

[root@slave1 ~]# telnet 192.168.88.101 21
Trying 192.168.88.101...
Connected to 192.168.88.101.
Escape character is '^]'.
220 (vsFTPd 3.0.2)
user ftp
331 Please specify the password.
pass ftp
230 Login successful.
PORT 192,168,88,102,48,57     # 256*48+57=12345
200 PORT command successful. Consider using PASV.
list
150 Here comes the directory listing.
226 Directory send OK.
quit
221 Goodbye.
Connection closed by foreign host.

 2. 安装 yum install nc

[root@slave1 ~]# nc -l 192.168.88.102 12345
-rw-r--r--    1 0        0               0 Jul 15 02:37 1.txt
-rw-r--r--    1 0        0               0 Jul 15 02:37 2.txt
drwxr-xr-x    2 0        0               6 Jul 15 02:35 aa
drwxr-xr-x    2 0        0               6 Oct 30  2018 pub

 

二.匿名服务

1.更改配置文件

[root@mysqlb ~]# vim /etc/vsftpd/vsftpd.conf

anon_upload_enable=YES    允许匿名用户上传文件
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES

2.给目录加权限

[root@mysqlb ftp]# mkdir /var/ftp/panda
[root@mysqlb ftp]# ls
1.txt  2.txt  aa  panda  pub
[root@mysqlb ftp]# chmod 777 panda
[root@mysqlb ftp]# ll -d panda
drwxrwxrwx. 2 root root 6 7月  15 18:17 panda

3.重启服务

[root@mysqlb ~]# systemctl restart vsftpd

4.用另一个用户登录ftp

[root@slave1 ~]# lftp 192.168.88.101
lftp 192.168.88.101:~> ls
-rw-r--r--    1 0        0               0 Jul 15 02:37 1.txt
-rw-r--r--    1 0        0               0 Jul 15 02:37 2.txt
drwxr-xr-x    2 0        0               6 Jul 15 02:35 aa
drwxrwxrwx    2 0        0               6 Jul 15 10:17 panda
drwxr-xr-x    2 0        0               6 Oct 30  2018 pub
lftp 192.168.88.101:/> cd panda
lftp 192.168.88.101:/panda> put /etc/passwd
1027 bytes transferred
lftp 192.168.88.101:/panda> ls
-rw-------    1 14       50           1027 Jul 15 10:18 passwd
lftp 192.168.88.101:/panda> quit

  

 

 

转载于:https://www.cnblogs.com/MR-ws/p/11189848.html

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值