lrx182125 发表于 2019-1-26 13:30:28

ftp:550 failed to open file

  今天在安装vsftpd以后做限制实体用户的总下载流量的测试,选择了本机测试。将一个名为taddm.zip的文件放在apachetest用户的主目录下,然后用root执行ftp localhost,并输入apachetest的账号与密码,接下来get这个taddm.zip文件,发现报错如下:
  ftp> get taddm.zip
  local: taddm.zip remote: taddm.zip
  200 PORT command successful. Consider using PASV.
  550 Failed to open file.
  ftp> bye
  

  各种尝试后,在鸟哥那本书里面找到一种方法:
  #getsebool -a |grep ftp
  allow_ftpd_anon_write --> off
  allow_ftpd_full_access --> off
  allow_ftpd_use_cifs --> off
  allow_ftpd_use_nfs --> off
  allow_tftp_anon_write --> off
  ftp_home_dir --> off   就是这个,需要设置为on才可以
  ftpd_connect_db --> off
  ftpd_disable_trans --> off
  ftpd_is_daemon --> on
  ftpd_use_fusefs --> off
  httpd_enable_ftp_server --> off
  tftpd_disable_trans --> off
  接下来使用# setsebool -P ftp_home_dir=1
  # getsebool -a|grep ftp
  allow_ftpd_anon_write --> off
  allow_ftpd_full_access --> off
  allow_ftpd_use_cifs --> off
  allow_ftpd_use_nfs --> off
  allow_tftp_anon_write --> off
  ftp_home_dir --> on
  ftpd_connect_db --> off
  ftpd_disable_trans --> off
  ftpd_is_daemon --> on
  ftpd_use_fusefs --> off
  httpd_enable_ftp_server --> off
  tftpd_disable_trans --> off
  

  再使用get命令做测试,测试成功:
  # ftp localhost
  Connected to localhost.localdomain.
  220-welcome to this website, we can supply ftp service.
  220-the main service is for the real user.
  220-if you have any question, please connect to niaoge.
  220
  530 Please login with USER and PASS.
  530 Please login with USER and PASS.
  KERBEROS_V4 rejected as an authentication type
  Name (localhost:root): apachetest
  331 Please specify the password.
  Password:
  230 Login successful.
  Remote system type is UNIX.
  Using binary mode to transfer files.
  ftp> get taddm.zip
  local: taddm.zip remote: taddm.zip
  227 Entering Passive Mode (127,0,0,1,102,45)
  150 Opening BINARY mode data connection for taddm.zip (6143635 bytes).
  226 File send OK.
  6143635 bytes received in 0.017 seconds (3.5e+05 Kbytes/s)
  ftp>
  同时可以得到下载速度。



页: [1]
查看完整版本: ftp:550 failed to open file