RHCSA 8 Exam Practice Question 4 (Installing FTP Server In Linux)

RHCSA 8 Exam Practice Question 4

What Should I know About The RHCSA Exam

Question

Install a FTP server, and request to anonymous download from /var/ftp/pub catalog. (it needs you to configure yum direct to the already existing file server.)

The question is based On installing and configuring FTP server In The RHCSA, 8 Course on this website. It is also based on configuring yum local repository. If you have gone through this course, solving this wouldn’t be a problem.

RHCSA, 8 Course

Installing & configuring FTP server In Red Hat

Configuring yum local repository In Red Hat

Ask Your Questions

Answer

The question specifies we need to configure yum directly to an already existing file server.

That’s the file server we are going to download the vsftpd package from.

Note that sometimes, you may be given a FQDN or an IP to configure yum with. We will look at that scenario too.

1. create a yum repository configuration file.

If the ISO image is on the system, and mounted in, “/mnt”, create the configuration file as shown below

[root@HQDEV1 ~]# vi /etc/yum.repos.d/local.repo
[rhel8_Appstream]
baseurl=file:///mnt/AppStream
gpgcheck=0
name=Red Hat Ent Linux App_stream
enable=1


[rhel8_BaseOS]
baseurl=file:///mnt/BaseOS
gpgcheck=0
name=Red Hat Ent Linux BaseOS
enable=1

If you are given an IP for a http server or FQDN to configure the yum configuration file with, create the configuration file as it is shown below. (you may click on the video link at the end of the page if you wish)

[rhel8_Appstream_remote]
baseurl=http://192.168.170.173/AppStream
gpgcheck=0
name=Red Hat Ent Linux App_stream remote
enable=1


[rhel8_BaseOS_remote]
baseurl=http://192.168.170.173/BaseOS
gpgcheck=0
name=Red Hat Ent Linux BaseOS remote
enable=1

2. Download the FTP server

[root@DRDEV1 ~]# yum install vsftpd

Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Red Hat Ent Linux App_stream remote                      125 kB/s | 3.2 kB     00:00
Red Hat Ent Linux BaseOS remote                           56 kB/s | 2.8 kB     00:00
Dependencies resolved.

....

3. configure the FTP server for anonymous download

Edit the vsftpd configuration file by searching for the line “anonymous_enable”, comment out the line and set the value to YES

[root@HQDEV1 ~]# vi /etc/vsftpd/vsftpd.conf
RHCSA 8 exam practice question 4

4. Start the vsftpd server

[root@HQDEV1 ~]# systemctl start vsftpd

5. Verify the status of the server

[root@HQDEV1 ~]# systemctl status vsftpd

● vsftpd.service - Vsftpd ftp daemon
   Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-07-02 23:27:21 WAT; 1min 15s ago
  Process: 36656 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=0/SUCCESS)

6. Test your configuration with the lftp utility

[root@HQDEV1 ~]# yum install lftp

7. Connect to the server

[root@HQDEV1 ~]# lftp localhost
lftp localhost:~> ls
-rw-r--r--    1 0        0             776 Jul 04 17:49 fstab
drwxr-xr-x    2 0        0               6 Feb 17 09:35 pub
lftp localhost:/>

Now that you can connect, your configuration is successful

Solution Summary

vi /etc/yum.repos.d/local.repo

yum install vsftpd

vi /etc/vsftpd/vsftpd.conf

systemctl start vsftpd

systemctl status vsftpd

yum install lftp

lftp localhost

Your feedback is welcomed. If you love others, you will share with others

6 Comments

  1. hello, i have applied all the processes mentioned above but i have this error message when i try to download on client
    Curl error (9): Access denied to remote resource for ftp://vmserver.example.com/repo/BaseOS/repodata/repomd.xml [Server denied you to change to the given directory]
    Error: Failed to download metadata for repo ‘BaseOS’: Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

    • **[Server denied you to change to the given directory]** seems the issue is from the server, you need to double check the configuration on the server. Check the permissions as well.

      The second error seems like a broken repository, make sure the repository is enabled, and gpgcheck is set to 0. Have you tried “yum repolist” to see the lists of available repositories?

    • Yes, you are right. FTP, HTTP and LDAP have been removed at the moment. However, I will advise one still learn HTTP, even FTP because of other topics that referred to these solutions. E.g, SELinux. It’s gonna be an advantage.

      Also, FTP, HTTP and LDAP will be removed from the next edition that we are presently working on.

  2. Had issues with the repo in the exam, used dnf config-manger —add-repo=http(baseurl) but yet still couldn’t able to install packages. What did I do wrong?

    • did you try “yum repolist all” to be sure you could see the configured repositories. Did you double check the repo config file? if you did it right, you will be able to install packages.

Leave a Reply

Your email address will not be published.


*