本文将搭建一个最简单的ftp服务,即通过root用户可进行登录、上传、下载,具体步骤如下:

  1、安装vsftpd服务

sudo apt-get install vsftpd

  2、编辑vsftp配置文件

vi /etc/vsftpd.conf 
local_enable=YES   #打开这一行,允许本地用户登录
write_enable=YES   #打开这一行,配置ftp可写
pam_service_name=ftp   #因为ubuntu启用了PAM,这一行要更改为ftp

  3、重启服务

service vsftpd restart

  4、测试

D:\>ftp 106.0.*.*
连接到 106.0.*.*220 (vsFTPd 2.3.5)
用户(106.0.*.*:(none)): root
331 Please specify the password.
密码:
230 Login successful.
ftp> dir
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
-rw-r--r--    1 0        0              10 Oct 26 10:37 1.txt
-rw-------    1 0        0              10 Oct 26 10:39 2.txt
226 Directory send OK.
ftp: 收到 126 字节,用时 0.00秒 126.00千字节/秒。
ftp> get 1.txt
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for 1.txt (10 bytes).
226 Transfer complete.
ftp: 收到 10 字节,用时 0.00秒 10000.00千字节/秒。
ftp> put 2.txt
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 Transfer complete.
ftp: 发送 10 字节,用时 0.01秒 1.11千字节/秒。
ftp>

 

相关文章:

  • 2021-05-22
  • 2021-11-17
  • 2022-12-23
  • 2021-12-13
  • 2021-10-18
  • 2022-01-04
  • 2021-11-05
猜你喜欢
  • 2021-11-19
  • 2022-01-10
  • 2022-01-03
  • 2022-01-30
  • 2022-12-23
  • 2022-12-23
  • 2021-07-02
相关资源
相似解决方案