How to install FTP server on oracle Linux

To Install and configure vsftpd server on oracle linux

Introduction :

• FTP stands for file transfer protocol, used for transfer files from a server to the network. • FTP is built on a client–server model architecture. • The initial client-to-server connection on port 21.

Installation steps :

Step 1 : check the OS version by using the below command

[root@linuxhelp ~]# cat /etc/os-release 
NAME="Oracle Linux Server"
VERSION="8.4"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.4"

Step 2 : Install vsftpd packages by using the below command

 [root@linuxhelp ~]# yum install vsftpd
Last metadata expiration check: 20:47:21 ago on Friday 26 November 2021 09:35:06 AM IST.
Dependencies resolved.
Installing:
 vsftpd                        x86_64                        3.0.3-34.el8                        ol8_appstream                        181 k
  Verifying        : vsftpd-3.0.3-34.el8.x86_64                                                                                         1/1 
Installed:
  vsftpd-3.0.3-34.el8.x86_64                                                                                                                
Complete!

Step 3 : Start the vsftpd service by using the below command

[root@linuxhelp ~]# systemctl start vsftpd

Step 4 : Enable the vsftpd service by using the below command

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

Step 5 : Check the status of vsftpd service by using the below command

 [root@linuxhelp ~]# systemctl status vsftpd
● vsftpd.service - Vsftpd ftp daemon
   Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2021-11-27 06:22:52 IST; 28s ago
 Main PID: 6863 (vsftpd)
    Tasks: 1 (limit: 10509)
   Memory: 648.0K
   CGroup: /system.slice/vsftpd.service
           └─6863 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf

Nov 27 06:22:52 linuxhelp systemd[1]: Starting Vsftpd ftp daemon...
Nov 27 06:22:52 linuxhelp systemd[1]: Started Vsftpd ftp daemon.
**Step 6 : Create user for ftp by using the below command** ``` [root@linuxhelp ~]# useradd ftpuser ``` **Step 7 : Set password for the ftpuser by using the below command** ``` [root@linuxhelp ~]# passwd ftpuser Changing password for user ftpuser. New password: BAD PASSWORD: The password is shorter than 8 characters Retype new password: passwd: all authentication tokens updated successfully ```

Step 8 : Add the ftpuser into userlist file by using the below command

[root@linuxhelp ~]# vim /etc/vsftpd/user_list

# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
ftpuser

step 9 : Edit the configuration file ensure the followings lines are uncomment by using the below command

[root@linuxhelp ~]# vim /etc/vsftpd/vsftpd.conf 
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=NO
listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES
userlist_deny=NO

step 10 : Restart the vsftpd service by using the below command

 [root@linuxhelp ~]# systemctl restart vsftpd

Step 11 : create some files in ftpuser home directory by using the below command

 [root@linuxhelp ~]# touch /home/ftpuser/abc{1..10}

Step 12 : check whether the client package is installed by using the below command

[root@client ~]# rpm -q ftp
package ftp is not installed

step 13 : Install the ftp package by using the below command

 [root@client ~]# yum install ftp
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
--> Running transaction check
---> Package ftp.x86_64 0:0.17-67.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
Installing:
 ftp                         x86_64                         0.17-67.el7                            ol7_latest                          60 k
Install  1 Package
Total download size: 60 k
  Verifying  : ftp-0.17-67.el7.x86_64                                                                                                   1/1 
Installed:
  ftp.x86_64 0:0.17-67.el7                                                                                                                  
Complete!

Step 14 : Connect to the ftp server by using the below command

[linux@client ~]$ ftp 192.168.6.132
Connected to 192.168.6.132 (192.168.6.132).
220 (vsFTPd 3.0.3)
Name (192.168.6.132:linux): ftpuser
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.

Step 15 : List the content by using the below command

ftp> ls
227 Entering Passive Mode (192,168,6,132,246,40).
150 Here comes the directory listing.
-rw-r--r--    1 0        0               0 Nov 27 01:15 abc1
-rw-r--r--    1 0        0               0 Nov 27 01:15 abc10
-rw-r--r--    1 0        0               0 Nov 27 01:15 abc2
-rw-r--r--    1 0        0               0 Nov 27 01:15 abc3
-rw-r--r--    1 0        0               0 Nov 27 01:15 abc4
-rw-r--r--    1 0        0               0 Nov 27 01:15 abc5
-rw-r--r--    1 0        0               0 Nov 27 01:15 abc6
-rw-r--r--    1 0        0               0 Nov 27 01:15 abc7
-rw-r--r--    1 0        0               0 Nov 27 01:15 abc8
-rw-r--r--    1 0        0               0 Nov 27 01:15 abc9
226 Directory send OK.

Step 16: Download the contents by using the below command

ftp> get abc1
local: abc1 remote: abc1
227 Entering Passive Mode (192,168,6,132,22,142).
150 Opening BINARY mode data connection for abc1 (0 bytes).
226 Transfer complete.

Step 17 : Check the downloads by using the below command

ftp> !ls
abc1  Desktop  Documents  Downloads  Music  Pictures  Public  Templates  test.txt  Videos

step 18 : Exit from the ftp

ftp> exit
221 Goodbye

By this Installation and configuration of vsftpd server on oracle Linux has come to an end.

FAQ
Q
Is FTP use userdatagram protocol ?
A
No, its run under TCP protocol.
Q
What is SFTP stands for?
A
SFTP stands for ssh file transfer protocol.
Q
Is it possible to access the FTP as an Anonymous user?
A
Yes, if it is enabled we can login.
Q
What is the port used by FTP?
A
port 21 is used by default.
Q
What FTP stands for?
A
FTP stands for file transfer protocol.