在LINUX下vsftp建立一个FTP服务器,但通过ftp的命令控制台使用FTP时,ls无法查看目录, 当然更无法上传下载文件了!
出错如下 :
ftp> ls
227 Entering Passive Mode (192,168,2,222,110,161)
150 Here comes the directory listing.
226 Directory send OK.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
226 Directory send OK.
查看ftp的命令
ftp> help
Commands may be abbreviated. Commands are:
! cr mdir proxy send
$ delete mget sendport site
account debug mkdir put size
append dir mls pwd status
ascii disconnect mode quit struct
bell form modtime quote system
binary get mput recv sunique
bye glob newer reget tenex
case hash nmap rstatus trace
ccc help nlist rhelp type
cd idle ntrans rename user
cdup image open reset umask
chmod lcd passive restart verbose
clear ls private rmdir ?
close macdef prompt runique
cprotect mdelete protect safe
通过 passive 开启和关闭 PASV模式, 再ls 也是同样的问题, 最后在网上找到了解决办法,最重要的是manftpd_selinux,解决这个问题只要:
1.setsebool-Pftpd_disable_trans1
2.servicevsftpdrestart
当然了,解决这个问题的办法还有一个, 就是禁用selinux
如何禁用呢?
vi /etc/sysconfig/selinux
SELINUX=enforcing --> SELINUX=disabled
但是这个修改需要重新启动计算机,reboot 一下。
下面是其他常见的setsebool 命令
BOOLEANS
SELinux policy is based on least privilege required and may also be customizable by setting
a boolean with setsebool.
Allow ftp servers to read and write files with the public_content_rw_t file type.
setsebool -P allow_ftpd_anon_write on
Allow ftp servers to read or write files in the user home directories.
setsebool -P ftp_home_dir on
Allow ftp servers to read or write all files on the system.
setsebool -P allow_ftpd_full_access on
Allow ftp servers to use cifs for public file transfer services.
setsebool -P allow_ftpd_use_cifs on
Allow ftp servers to use nfs for public file transfer services.
setsebool -P allow_ftpd_use_nfs on
system-config-selinux is a GUI tool available to customize SELinux policy settings.
分享到:
相关推荐
FileZilla linux 上传 ftp putty linux终端工具 vsftp
linux 下的vsftp配置
vsftp配置大全,linux下ftp配置
Vsftp的PASV mode(被动模式传送)和Port模式及 Linux下VsFTP配置全方案,需要配置Linux下的FTP很有用
linux下vsftp的搭建及quota的使用
Linux_VSFTP服务器详细配置,比较详细的对ftp进行了讲解,并且讲述了配置vsftp的步骤!
NULL 博文链接:https://zhouwenjun.iteye.com/blog/565848
Linux下vsftp配置大全.doc
解决vsftp 不能匿名上传文件的问题,希望大家一定要注意这一点,一定不要忘记。
设置linux系统ftp工具,除了gsfp的一个linux传输工具软件。
linux下vsftp源码安装搭建 只是简单搭建没利用数据库认证,设置用户密码比较实用
LINUX下FTP服务器架设--VSFTP配置
Linux vsftp配置手册Linux vsftp配置手册Linux vsftp配置手册Linux vsftp配置手册Linux vsftp配置手册Linux vsftp配置手册
解析Linux下vsFTP安全认证.pdf
linux下VSFTP的搭建及优化.pdf
linux c vsftp 原码 学习 提高
linux ftp上传配置 Vsftp支持限额配置