How to install and configure FTP on Fedora 34
To Install and configure FTP on Fedora 34.
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.
Step 1: Check the OS version by using the below command
[root@linuxhelp ~]# cat /etc/os-release
NAME=Fedora
VERSION="34 (Workstation Edition)"
ID=fedora
VERSION_ID=34
VERSION_CODENAME=""
PLATFORM_ID="platform:f34"
PRETTY_NAME="Fedora 34 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:34"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/34/system-administrators-guide/"
VARIANT_ID=workstation
Step 2: Install vsftpd service protocol by using the below command
[root@linuxhelp ~]# dnf install vsftpd -y
Last metadata expiration check: 2:47:17 ago on Wed 10 Nov 2021 01:33:26 PM IST.
Dependencies resolved.
Package Architecture Version Repository Size
Installing:
vsftpd x86_64 3.0.3-43.fc34 updates 156 k
Transaction Summary
==========================================================================================================================
Install 1 Package
Total download size: 156 k
Installed size: 343 k
Downloading Packages:
vsftpd-3.0.3-43.fc34.x86_64.rpm 76 kB/s | 156 kB 00:02
--------------------------------------------------------------------------------------------------------------------------
Total 56 kB/s | 156 kB 00:02
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : vsftpd-3.0.3-43.fc34.x86_64 1/1
Running scriptlet: vsftpd-3.0.3-43.fc34.x86_64 1/1
Verifying : vsftpd-3.0.3-43.fc34.x86_64 1/1
Installed:
vsftpd-3.0.3-43.fc34.x86_64
Complete!
Step 3: Open vsftpd configuration file by using the below command
[root@linuxhelp ~]# vim /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
Step 4: Add new user by using the below command
[root@linuxhelp ~]# adduser newuser
Step 5: Give password in that user by using the below command
[root@linuxhelp ~]# passwd newuser
Changing password for user newuser.
New password:
BAD PASSWORD: The password contains the user name in some form
Retype new password:
passwd: all authentication tokens updated successfully.
Step 6: Start vsftpd service by using the below command
[root@linuxhelp ~]# systemctl start vsftpd
Step 7: Enable 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 8: Check the vsftpd status 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 Wed 2021-11-10 16:27:31 IST; 45s ago
Main PID: 2902 (vsftpd)
Tasks: 1 (limit: 4965)
Memory: 572.0K
CPU: 6ms
CGroup: /system.slice/vsftpd.service
└─2902 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
Step 9: Change the directory to home by using the below command
[root@linuxhelp ~]# cd /home
Step 10: Check the directory to using ls command and change directory to newuser
[root@linuxhelp home]# ls
linuxhelp newuser
[root@linuxhelp home]# cd newuser
Step 11: Need to make new directory like this and change the directory to using cd command.
[root@linuxhelp newuser]# mkdir folder
[root@linuxhelp newuser]# cd folder
Step 12: Create new file here like this (file1 and file2) and check this using ls command.
[root@linuxhelp folder]# touch file1
[root@linuxhelp folder]# touch file2
[root@linuxhelp folder]# ls
file1 file2
Step 13: Check the IP address by using the below command
[root@linuxhelp folder]# ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:0c:29:a7:45:98 brd ff:ff:ff:ff:ff:ff
altname enp2s1
inet 192.168.6.125/23 brd 192.168.7.255 scope global noprefixroute ens33
valid_lft forever preferred_lft forever
inet6 fe80::e2eb:b5d6:40ab:3b84/64 scope link noprefixroute
valid_lft forever preferred_lft forever
Step 14: Login FTP from the root by using local IP.
[root@linuxhelp ~]# ftp 192.168.6.125
Connected to 192.168.6.125 (192.168.6.125).
220 (vsFTPd 3.0.3)
Name (192.168.6.125:root): newuser
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
ftp>
ftp>
ftp>
ftp> exit
221 Goodbye.
Step 15: Login ftp user and then access the FTP by using your local IP.
[root@linuxhelp ~]# su - newuser
[newuser@linuxhelp ~]$ ftp 192.168.6.125
Connected to 192.168.6.125 (192.168.6.125).
220 (vsFTPd 3.0.3)
Name (192.168.6.125:newuser): newuser
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
ftp>
ftp>
ftp> ftp>
ftp> exit
221 Goodbye.
Step 16: Check the FTP user location and change the user to using cd and use ls command.
[newuser@linuxhelp ~]$ cat /etc/passwd | grep newuser
newuser:x:1001:1001::/home/newuser:/bin/bash
[newuser@linuxhelp ~]$ cd /home/newuser
[newuser@linuxhelp ~]$ ls
Folder
Step 17: Change the directory and check the directory to using ls command.
[newuser@linuxhelp ~]$ cd folder
[newuser@linuxhelp folder]$ ls
file1 file2
Step 18: Open this file and put inside what you like (any content).
[newuser@linuxhelp folder]$ vi file1
Hi this is test file for ftp
Step 19: Next, go to the client-side local file search bar and enter the system Ip address like this ftp://192.168.6.125 it will access your ftp server as shown in the below images
Step 20: Create Permission for higher level directory to edit configuration file by using the below command
[root@linuxhelp ~]# vim /etc/vsftpd/vsftpd.conf
Step 21: After edit configuration file. Restart the vsftp service by using the below command
[root@linuxhelp ~]# systemctl restart vsftpd.
Step 22: After restart service go to access the higher-level directory. It will show the user login credentials as shown in the below images
Conclusion:
We have reached the end of this article. In this guide, we have walked you through the steps required to Install and configure FTP on Fedora 34. Your feedback is much welcome.
Traditionally these are port 21 for the command port and port 20 for the data port
the second one (FTP client) will run on your desktop
spoofing, and brute force attacks, among other basic attack methods.