[SOLVED] WEB375 LAB 4 CONFIGURE A VSFTP SERVER IN LINUX: The purpose of this Lab is to configure the vsftp server in Linux. Use the IP addresses that exist when you start Linux.
Virtual Machine Login Information for PLABFED01 and PLABFED02
Username: Student
Password: Password
Username: root
Password: Password
Lab Diagram
During your session you will have access to the following lab configuration.
WINCONSOLE PLABFED01 PLABFED02
The Linux servers also connect to a private network. The IP address of PLABFED01 is 192.168.240.11 and the IP address of PLABFED01 is 192.168.240.12.
Connecting to Your Lab
In this module you will be working on the following equipment to carry out the steps defined in each exercise.
Each exercise will detail which console you are required to work on to carry out the steps.
To start, simply click on the named server from the device list (located on the left hand side of the screen) and click the Power on from the Tools bar. In some cases, the devices may power on automatically.
During the boot up process, an activity indicator will be displayed in the Name tab:
If the remote console is not displayed automatically in the main window (or popup) click the Connect icon located in the tools bar to start your session.
If the remote console does not appear, please try the following option:
In the event this does not resolve your connectivity problems, please visit our Help / Support pages for additional resolution options.
[SOLVED] WEB375 LAB 4 CONFIGURE A VSFTP SERVER IN LINUX: TASK A – Read General Background Information on vsftp server:
This is the background information to help you do your Lab. Read this to get a general understanding of how to configure a vsftp server.
Become Familiar with vsftp Files
Setting up the server will be done in two steps: Setting up the configuration files for vsftp, and then starting the vsftp services.
[SOLVED] WEB375 LAB 4 CONFIGURE A VSFTP SERVER IN LINUX: TASK B – Configure Basic Settings for vsftpd Step-By-Step
We start setting up a basic vsftp server. As always when doing any type of system administration, we need to perform them using root account. Use Putty to logon plabfed01 as root.
Step 1: To stop all firewalls or security features, type the following commands:
#systemctl stop firewalld
#systemctl stop iptables
#setsebool -P ftp_home_dir=1
Step 2: Make sure the vsftpd packages are installed. You should be able to discover this with the following command:
#rpm -q vsftpd
If it tells you that vsftpd is not installed, to install it type:
#yum –y install vsftpd
Step 3: The file /etc/vsftpd/vsftpd.conf controls the configuration of vsftp. Use the nano or vi editor to remove the # symbol before each directive (if they are not already done) and set it to YES or NO. We only go over some directives below so you understand how to customize it, and leave the others at the default setup.
#nano /etc/vsftpd/vsftpd.conf
Check the /etc/vsftpd/user_list file to see which users are denied access to the vsftpd server.
Below is a partial list of the /etc/vsftpd/vsftpd.conf file.
Note: Lines preceded by the # symbol are comments.
Step 4: After modifying the /etc/vsftpd/vsftpd.conf file, start the vsftpd service.
#systemctl start vsftpd
Note: If the file /etc/vsftpd/vsftpd.conf is modified, in order to make it effective, you need to restart the vsftpd.
Step 5: To check vsftpd status type:
#systemctl status vsftpd
An active vsftpd status looks like this:
Note: If vsftpd fails to start, check for errors using command journalctl –xn, fix any typo in the /etc/vsftpd/vsftpd.conf file, and restart the service with command #systemctl restart vsftpd until vsftpd starts successfully.
Below is a sample of journalctl –xn command output without any error.
Step 6: To enable the vsftp server during boot, type the following command:
#systemctl enable vsftpd.service
[SOLVED] WEB375 LAB 4 CONFIGURE A VSFTP SERVER IN LINUX: TASK C –Validation and Testing
Now we need to have two Putty sessions, one logon plabfed01 and the other on plabfed02
Arrange the terminal so we can switch back and forth easily. See the screenshot below:
Step 1: Create a user account on plabfed01 (vsftp server) using these commands with the password Password:
#useradd usera
#passwd usera
Step 2: Create a user account on plabfed02 (ftp client) using these commands with the password Password:
#useradd userb
#passwd userb
[SOLVED] WEB375 LAB 4 CONFIGURE A VSFTP SERVER IN LINUX: Step 3: Create a test file on plabfed01: Logon to usera on plabfed01 by using su – usera and create a file called hello (use nano hello) with the message “This message is from userA” and save it.
Step 4: Create a test file on plabfed02: Logon to userb on plabfed02 by using su – userb and create a file called hello (use nano hi) with the message “This message is from userB” and save it.
See the screenshot below:
Step 5: We are going to use vsftp to upload the file “hi” from the userb account on plabfed02 (ftp client) to usera account plabfed01 (vsftp server). The resulting screenshot should look like this:
Step 6: We are going to use vsftp to download the file “hello” from the usera account on plabfed01 (vsftp server) to userb account plabfed02 (ftp client). The resulting screenshot should look like this:
Step 7: We are going to test if the anonymous FTP logon worked. It should fail since we disabled anonymous logon. We do this from the userb account on plabfed02. The resulting screenshot should look like this:
[SOLVED] WEB375 LAB 4 CONFIGURE A VSFTP SERVER IN LINUX: TASK D – Lab Report Preparation
Step 1: Be sure in root account on plabfed01. Clear the screen and use the command #tail -4 /etc/passwd file to display its last four lines and capture the Linux desktop. Save this image to your Lab Report document in the space allocated for the #tail -4 /etc/passwd command.
[SOLVED] WEB375 LAB 4 CONFIGURE A VSFTP SERVER IN LINUX: Step 2: Be sure in userb account on plabfed02. Clear the screen, type the command #cat hi to display its contents and capture the Linux desktop. Save this image to your Lab Report document in the space allocated for the hi file.
Step 3: Be sure in root account on plabfed01. Clear the screen and type the command #systemctl status vsftpd to display the vsftpd daemon status and capture the Linux desktop. Save this image to your Lab Report document in the space allocated for the #systemctl status vsftpd command.
Step 4: Be sure in userb account on plabfed02. Clear the screen, then FTP to 192.168.240.11 and logon as usera. Capture the Linux desktop and save this image to your Lab Report document in the space allocated for FTP and logon as usera.
[SOLVED] WEB375 LAB 4 CONFIGURE A VSFTP SERVER IN LINUX: Step 5: Be sure in userb account on plabfed02. Clear the screen, then FTP to 192.168.240.11 and logon as anonymous. Capture the Linux desktop and save this image to your Lab Report document in the space allocated for FTP and logon as anonymous.
Step 6: Configure vsftp allowing anonymous login and test it.
[SOLVED] WEB375 LAB 4 CONFIGURE A VSFTP SERVER IN LINUX: Step 7: Configure vsftp to only disallow usera login and test it.