Anda di halaman 1dari 2

#FTP Server in CentOS 7

Step 1: Installing FTP Server


yum install vsftpd
yum install vsftpd

#Iniciar Servicios
systemctl start vsftpd

#Start automatically:
systemctl enable vsftpd

# Next, in order to allow access to FTP services from external systems,


we have to open port 21, where the FTP daemons are listening as follows:

firewall-cmd --zone=public --permanent --add-port=21/tcp


firewall-cmd --zone=public --permanent --add-service=ftp
firewall-cmd --reload

Step 2: Configuring FTP Server

#Crear un respaldo
cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.orig

#Editar FTP Server


vi /etc/vsftpd/vsftpd.conf

#Next, open the config file above and set the following options

anonymous_enable=NO # disable anonymous login


local_enable=YES # permit local logins
write_enable=YES # enable FTP commands which change the filesystem
local_umask=022 # value of umask for file creation for local users
dirmessage_enable=YES # enable showing of messages when users first enter
a new directory
xferlog_enable=YES # a log file will be maintained detailing uploads and
downloads
connect_from_port_20=YES # use port 20 (ftp-data) on the server machine for
PORT style connections
xferlog_std_format=YES # keep standard log file format
listen=NO # prevent vsftpd from running in standalone mode
listen_ipv6=YES # vsftpd will listen on an IPv6 socket instead of
an IPv4 one
pam_service_name=vsftpd # name of the PAM service vsftpd will use
userlist_enable=YES # enable vsftpd to load a list of usernames
tcp_wrappers=YES # turn on tcp wrappers

#Now add these two following options to restrict FTP users


to their Home directories.

100 Descomentar: Permite enjaular usuarios en un carpeta.


chroot_local_user=YES

101 A�adir
allow_writeable_chroot=YES

#Reestablecer Servicios
systemctl restart vsftpd
/*******************************************************************/
Step 4: Testing FTP Server
#Crear Usuario
useradd -m oscarftp -s /sbin/nologin
passwd oscarftp

chown root /home/oscarftp/


chmod 777 /home/oscarftp/

mkdir /home/oscarftp/www
chown nobody:nobody /home/oscarftp/www/
chmod 777 /home/oscarftp/www

mkdir /var/www/html/user
chown nobody:nobody /var/www/html/user/
chmod 777 /var/www/html/user/

#Crear Enlace
mount --bind /var/www/html/user /home/oscarftp/www

#Reestablecer Servicios
systemctl restart vsftpd

#So So
setsebool -P ftp_home_dir on
#Vale
setsebool -P allow_ftpd_full_access on

/*****************************************************************/
AYUDA PAGINA
https://www.tecmint.com/install-ftp-server-in-centos-7/
https://www.unixmen.com/install-configure-ftp-server-centos-7/
https://www.muylinux.com/2014/10/15/servidor-ftp-centos-7/
https://www.solvetic.com/tutoriales/article/3212-como-instalar-servidor-ftp-linux-
centos7/

Anda mungkin juga menyukai