为/ var / www / in centos配置proftpd用户访问权限

前端之家收集整理的这篇文章主要介绍了为/ var / www / in centos配置proftpd用户访问权限前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在配置proftpd时遇到问题,以允许系统用户访问centos框上的/ var / www /.

proftpd.conf中

ServerName                      "ProFTPD server"
ServerIdent                     on "FTP Server ready."
ServerAdmin                     root@localhost
ServerType                      standalone
DefaultServer                   on
VRootEngine                     on
#DefaultRoot                    ~ !adm
DefaultRoot                     /var/www/
VRootAlias                      /etc/security/pam_env.conf etc/security/pam_env.conf
AuthPAMConfig                   proftpd
AuthOrder                       mod_auth_pam.c* mod_auth_unix.c
#PersistentPasswd               off
UseReverseDNS                   off
User                            nobody
Group                           nobody
MaxInstances                    20
UseSendfile                     off
LogFormat                       default "%h %l %u %t \"%r\" %s %b"
LogFormat                       auth    "%v [%P] %h %t \"%r\" %s"

<Global>
  Umask                         022
  AllowOverwrite                yes
  <Limit ALL SITE_CHMOD>
    AllowAll
  </Limit>
</Global>

<Limit LOGIN>
AllowUser ftpuser
DenyALL
</Limit>

我创建了一个系统用户’ftpuser’,其主目录为/ var / www /和一个有效的shell.我可以作为这个用户ssh in并查看正确的目录等.

但是,当我尝试使用ftp客户端连接或甚至从shell连接到localhost时,我收到错误

Status: Connecting to 10.0.10.10:21...
Status: Connection established,waiting for welcome message...
Response:   220 FTP Server ready.
Command:    USER ftpuser
Response:   331 Password required for ftpuser
Command:    PASS *******
Response:   230 User ftpuser logged in
Command:    OPTS UTF8 ON
Response:   200 UTF8 set to on
Status: Connected
Status: Retrieving directory listing...
Command:    PWD
Response:   257 "/" is the current directory
Command:    TYPE I
Response:   200 Type set to I
Command:    PASV
Response:   227 Entering Passive Mode (10,10,184,18).
Command:    MLSD
Response:   550 /: Invalid argument
Error:  Failed to retrieve directory listing

要么:

telnet localhost 21
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 FTP Server ready.
user ftpuser
331 Password required for ftpuser
pass PASSWD
230 User ftpuser logged in
LIST
425 Unable to build data connection: Invalid argument
MLSD
550 /: Invalid argument

有谁知道这里发生了什么&怎么解决

检查SElinux是不是会导致您出现问题
setenforce 0

如果这可以解决你的问题,那么重新打开SELinux(setenforce 1),然后尝试设置ftp_home_dir布尔值

setsebool -P ftp_home_dir on

这将允许ftp守护进程访问用户主目录.

原文链接:https://www.f2er.com/centos/373462.html

猜你在找的CentOS相关文章