File Transfer Protocol (FTP) On VMware

File Transfer Protocol (FTP) | System Administration Network



A. Learning Objective

Know what FTP is in general and be able to configure FTP in VMware properly and correctly.


 B. Learning Materials

 FTP (File Transfer Protocol) is a method used to send and receive files between two computers over a network, such as the internet. With FTP, one can upload files from their computer to a server, or download files from a server to their computer. Typically, FTP is used to manage files on a website or storage server. To access FTP, you can use specialized applications such as FileZilla or through commands in the terminal/command prompt.

 C. Working Media

  1. Laptop 


  2. Debian 11 ISO

  3. VMware Workstation Pro 16


  4. Putty

D. Configuration FTP

  1. Open putty to remote the server. We can remote the server with hostname or IP Host in Debian Server. Select SSH for connection type, then click open.


  2. Move the directory to apt with the cd /etc/apt command and then type the ls command to view the files in the directory. Then backup the contents of the sources.list file to sources.list.backup with the cp sources.list sources.list.backup command and enter ls whether the backup file already exists.


  3. Go to chrome and search for the debian 11 repository, copy the repository.


  4. Remove the contents of the file from sources.list and go into the file with the nano.sources.list command.

  5. Paste the debian 11 repository into the sources.list. If so, press CTRL+X+Y.


  6. Perform an apt update.


  7. Enter the cat sources.list command to view the contents of the files inside the file.


  8. Enter the bind directory with the cd /etc/bind9 command then enter the ls command to see the list of files in the directory. Then enter the nano db.domain command to edit the db.domain file.

  9. Edit the db.domain file and add a new subdomain entry for FTP in the local DNS zone configuration. Use the following format:

    ftp     IN       A      172.18.0.11 (ip address server)

    This line creates an A (IPv4) record for the ftp subdomain under giribelajar.net, pointing it to IP address 172.18.0.11. This means when someone accesses ftp.giribelajar.net, it will go to the internal IP address 172.18.0.11 where the FTP server is hosted. After editing the file, press CTRL+X, then Y, and ENTER on your keyboard to save and exit the editor.

  10. After making changes to the DNS zone file, the systemctl restart bind9 command is used to restart the BIND9 DNS service so that configuration changes can be applied. Next, testing is done with the ping ftp.giribelajar.net command to ensure that the ftp.giribelajar.net subdomain is successfully resolved to the previously specified IP address, which is 172.18.0.11. The ping results show a reply from the IP address, which means that DNS is functioning correctly and the ftp.giribelajar.net subdomain is successfully recognized by the system.

  11. The nano /etc/hosts command is used to open and edit the /etc/hosts file, which is a local configuration file used by the operating system to map hostnames to IP addresses directly. By editing this file, users can add domain or subdomain entries such as ftp.giribelajar.net to be recognized by the system without having to rely on external DNS servers.

  12. The contents of the /etc/hosts file in the figure show that the local IP address 172.18.0.11 has been mapped to several host names, such as ftp.giribelajar.net, giri.giri, and giri. The goal is for the system to recognize and access these names directly without having to contact the DNS server. This entry is very useful for local testing or internal networks, as it speeds up the process of domain name resolution into IP addresses.


  13. The apt install proftpd command is an instruction to the Debian or Ubuntu operating system to locate, download, and install a software package called proftpd along with all other required packages (dependencies) from a configured repository. The apt package management tool will search for packages in the available list, analyze their dependencies, download uninstalled packages and dependencies from the internet, and then perform the installation by placing the files into the appropriate locations and configuring the software to integrate with the system.

  14. You first look at the contents of the /home/ directory. Then, you create a new directory called fileftp. After that, you again look at the contents of the /home/ directory to verify that fileftp has been successfully created. Finally, you use the ls -al command to see a complete list of files and directories in /home/ along with their detailed information, including access permissions and ownership. These steps are common in file and directory management on Linux systems.

  15. The ls -al command displays a list of files and directories along with their access permission details, including the fileftp directory that has drwxr-xr-x permissions. Then, the chmod 777 fileftp/ command changes the access permissions of the fileftp directory to drwxrwxrwx, which grants read, write, and execute rights to the owner, group, and other users. Finally, the ls -al command is again run to verify the permission change on the fileftp directory, which now appears to have drwxrwxrwx permissions.

  16. You move the directory to /etc/proftpd/, view the contents list including proftpd.conf, make a copy of the configuration file into proftpd.conf.backup as a precaution, and then open the proftpd.conf file using the nano text editor to configure the ProFTPD server.

  17. This proftpd.conf file configures the ProFTPD FTP server by assigning the /home/fileftp directory as the virtual root directory for users after login, thus restricting their access outside of that directory. The server listens for control connections on the standard FTP port 21, and uses the port range 49152 to 65534 for data transfer in passive mode to overcome potential firewall issues on the client side. Lines preceded by # are explanatory comments and do not affect the server configuration. This configuration essentially sets the user's starting directory, control port, and passive data port range for the ProFTPD server.


  18. Follow the configuration command as below
    Exit root: You log out of administrator access (root) and revert back to regular user (giri).
    Log back in as root: You use the su -l command and enter the password to regain administrator (root) access.
    Creating a new user: You use the /usr/sbin/adduser giriftp11 command to create a new user named giriftp11. This process automatically creates a group with the same name and a home directory for the user.
    Setting a password: You were prompted and successfully set a password for the user giriftp11.
    User information: The system requests additional information about the new user, which you skip.
    Confirmation: You confirm that the new user information is correct.

  19. Follow the configuration command as below
    Exit root: You log out of administrator access (root) and revert back to regular user (giri).
    Log back in as root: You use the su -l command and enter the password to regain administrator (root) access.
    Creating a new user: You use the /usr/sbin/adduser giriftp22 command to create a new user named giriftp22. This process automatically creates a group with the same name and a home directory for the user.
    Setting a password: You were prompted and successfully set a password for the user giriftp22.
    User information: The system requests additional information about the new user, which you skip.
    Confirmation: You confirm that the new user information is correct.



  20. The working directory is changed to /etc/proftpd/. Then, the usermod -d /home/fileftp/ giriftp11 command is executed to change the home directory (where personal files are stored) of the giriftp11 user to /home/fileftp/. This means that, after this command is executed, when the giriftp11 user logs into the system, the initial directory where they are located and store files will be /home/fileftp/ instead of the default home directory created when the user was first added.

  21. The first command, /etc/init.d/proftpd restart, is used to restart the ProFTPD service. This will temporarily stop the server and then restart it, ensuring the latest configuration is applied. The second command, /etc/init.d/proftpd status, is used to check the state of the ProFTPD service. The output shows that the proftpd.service is active (running), which means the ProFTPD FTP server is successfully running and ready to accept connections.

  22. Login to the Windows 7 client, then do a ping experiment to find out whether the ftp that has been created/configured is connected or not. If connected, the results will be as below.

  23. The ftp ftp.giribelajar.net command is used to attempt to connect to the FTP server at the ftp.giribelajar.net address. Once connected, the server responds with code 220 indicating ProFTPD is running on Debian. Then, the user giriftp11 command is used to send the username giriftp11 to the server, which responds with code 331 asking for a password. After the password is entered (not visible in the image), the server gives code 230 indicating that user giriftp11 is successfully logged in. Next, the ls command is used to see a list of files and folders on the server, followed by the mkdir testcli command to create a new folder called testcli. The ls command is again used to verify the creation of the testcli folder. Finally, the bye command is used to disconnect from the FTP server, which the server responds to with a 221 code indicating the connection is closed.

  24. At the top, in the address bar, it says ftp://ftp.giribelajar.net/. This indicates that the user is trying to open or connect to the FTP server at ftp.giribelajar.net directly through the Windows file explorer interface.

  25. Then login with the user and enter the password according to what was created in the previous configuration.

  26. Two existing folders are visible, namely testcli and testgui. To add a new folder, the user right-clicks in an empty area of the window, which brings up a context menu. Within the menu, the user hovers over the “New” option, which opens a sub-menu. Within the “New” sub-menu, the user selects the “Folder” option to create a new folder on the FTP server. After selecting “Folder”, a new folder with a temporary name (usually “New folder”) appears, and the user can type in the desired name for the new folder.

  27. Login again but with a new ftp user.

  28. Go to microsoft edge on the client and try to access the configured ftp.




Komentar

Postingan Populer