How to install and configure FTP server on CentOS 7

To Install and configure FTP on Cent OS 7

Introduction:

FTP stands for file transfer protocol that is utilized to transfer files,we can also upload or download files from this protocol, for secure transmission that secures the username and password, and encrypts the content, FTP is designed using a client-server model that uses different data and control connections.

Installation Procedure:

[root@linuxhelp /]# yum install vsftpd
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.piconets.webwerks.in
 * extras: mirrors.piconets.webwerks.in
 * updates: mirrors.piconets.webwerks.in
Resolving Dependencies
Installed size: 353 k
Is this ok [y/d/N]: y
Downloading packages:
vsftpd-3.0.2-29.el7_9.x86_64.rpm                                          | 173 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : vsftpd-3.0.2-29.el7_9.x86_64                                                  1/1 
  Verifying  : vsftpd-3.0.2-29.el7_9.x86_64                                                  1/1 
Installed:
  vsftpd.x86_64 0:3.0.2-29.el7_9                                                                 
Complete!

Now move into the ftp configuration file

[root@linuxhelp /]# vim /etc/vsftpd/vsftpd.conf

Now Add user 1

[root@linuxhelp /]# adduser user1

Set the password for user 1

[root@linuxhelp /]# passwd user1
Changing password for user user1.
New password: 
BAD PASSWORD: The password fails the dictionary check - it is too simplistic/systematic
Retype new password: 
passwd: all authentication tokens updated successfully.

Start the vsftpd service

root@linuxhelp /]# systemctl start vsftpd

Make it enable service

[root@linuxhelp /]# systemctl enable vsftpd
Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.

To prevent the firewall block s the port for it we are disabling it

[root@linuxhelp /]# systemctl stop firewalld

Move in the home directory.

[root@linuxhelp /]# cd /home

List the files.

[root@linuxhelp home]# ls
linuxhelp  user1

change directory to user1

[root@linuxhelp home]# cd user1

Now make the ftp data folder

root@linuxhelp user1]# mkdir folder1
[root@linuxhelp user1]# cd folder1

Now create the file inside the folder1

[root@linuxhelp folder1]# touch file1

Now verifify

[root@linuxhelp folder1]# ls
file1
[root@linuxhelp folder1]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.6.117  netmask 255.255.255.0  broadcast 192.168.6.255
        inet6 fe80::20c:29ff:fe34:1bfa  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:34:1b:fa  txqueuelen 1000  (Ethernet)
        RX packets 14041  bytes 18302263 (17.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7134  bytes 497215 (485.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Now open your ftp with the server IP address in the format as shown

Now provide user name and password

With this configuration of FTP on centos 7 comes to an end.

Tag : FTP CentOS
FAQ
Q
How to fix 500 OOPS: cannot change directory:/home/user2?
A
To fix 500 OOPS: cannot change directory:/home/user2 error follow the below procedure
create the user by the following command
" useradd -d /srv/ftp/ user2 "
In case if you have created the user already by using " useradd user2 "
you have to manually create the user2 directory under the home directory and change ownership " chown -R user2 user2 "
Q
How to change the default vsftpd's root directory location?
A
To change the default VSFTPD's root directory location
Add the following line at the end of vsftpd.conf file without "#" symbol, local_root=example_directory
Q
What is vsftpd configuration file location
A
The VSFTPD configuration file location is /etc/vsftpd.conf
Q
What is the root directory location of vsftpd?
A
The root Directory Location of VSFTPD is /srv/ftp/
Q
What is the vsftpd?
A
Very Secure File Transfer Protocol Deamon' (VSFTPD) is one of the most secure FTP daemons available, vsftpd is used as the default FTP server in the Ubuntu, CentOS, Fedora, NimbleX, Slackware and RHEL Linux distros.