martes, 31 de agosto de 2021

Servidor ftp para apache

yum -y install vsftpd

systemctl status vsftpd

getenforce

vim /etc/vsftpd/vsftpd.conf

local_enable=YES

anonymous_enable=NO

anon_root=/home/pmb7
local_root=/var/www/html/PMB7
chroot_local_user=YES
allow_writeable_chroot=YES

 

cat /etc/group |grep ftp

useradd -g ftp -d /home/pmb7 pmb7

passwd pmb7 

systemctl restart vsftpd

getfacl /var/www/html/PMB7 

# file: PMB7/
# owner: apache
# group: apache
user::rwx
group::r-x
other::r-x

 

setfacl -m "u:pmb7:rwx" PMB7/

getfacl PMB7/
# file: PMB7/
# owner: apache
# group: apache
user::rwx
user:pmb7:rwx
group::r-x
mask::rwx
other::r-x

 

find PMB7/ -type d -exec chmod 2775 {} \;

find PMB7/ -type f -exec chmod ug+rw {} \;

getfacl PMB7/
# file: PMB7/
# owner: apache
# group: apache
# flags: -s-
user::rwx
user:pmb7:rwx
group::r-x
mask::rwx
other::r-x

find PMB7 -type f -exec chmod 644 {} \;

 

usermod -s /sbin/nologin pmb7

 vim  /etc/pam.d/vsftpd

Comentar la linea

 #auth       required     pam_shells.so

 

systemctl restart vsftpd

 

Fuente:

https://dimitar.me/how-to-create-an-ftp-user-and-allow-write-to-the-apache-root-directory-with-proper-permissions/

https://wiki.archlinux.org/title/Access_Control_Lists_(Espa%C3%B1ol)

https://comoinstalar.me/como-instalar-ftp-en-centos-7/

https://www.muylinux.com/2014/10/15/servidor-ftp-centos-7/



 

No hay comentarios:

Publicar un comentario