Install FTP Server and use the same
1. Install vsftpd (Very Secure FTP Daemon)
sudo apt-get install vsftpd
• Installs the vsftpd package on your system.
• vsftpd is a secure and lightweight FTP server.
• sudo ensures you have administrative privileges.
• apt-get is the package management tool for Debian-based systems like Ubuntu.
2. Edit the vsftpd Configuration File
sudo nano /etc/vsftpd.conf
• Opens the vsftpd configuration file using the nano text editor.
• The /etc/vsftpd.conf file contains settings that control the FTP server behavior.
Modify Configuration Settings
a) Disable Anonymous FTP Login
anonymous_enable=NO
• Prevents anonymous users from logging in.
• Ensures only authenticated users can access the FTP server.
b) Enable Local User Login
local_enable=YES
• Allows system users (those with accounts on the server) to log in via FTP.
c) Enable File Uploads
write_enable=YES
• Allows users to upload, modify, or delete files.
• Without this setting, the FTP server is read-only.
d) Restrict Users to Their Home Directory (Chroot Jail)
chroot_local_user=YES
• Prevents users from accessing directories outside their home folder.
• Improves security by isolating users to their designated directory.
e) Allow Writable Chroot (Optional)
allow_writeable_chroot=YES
• By default, vsftpd does not allow a writable root directory for security reasons.
• Enabling this setting allows users to write to their home directories while still being in a chroot
environment.
f) Save Changes and Exit nano
• Press CTRL + X to exit.
• Press Y to confirm saving.
• Press Enter to finalize.
3. Restart the vsftpd Service
sudo systemctl restart vsftpd
• Restarts the vsftpd service to apply configuration changes.
• systemctl restart is the correct command for managing services in modern Linux distributions.
• Ensures the FTP server is running with the updated settings.
4. Check Network Configuration
ifconfig
• Displays network interface details like IP address, subnet mask, and MAC address.
• Helps find the server's IP address for FTP connections.
• On some systems, you may need ip a instead.
5. Connect to an FTP Server
ftp <IP Address>
• Starts an FTP session to the server with the given <IP Address>.
• Allows users to transfer files over FTP.
Login Credentials
• Username: System user account name.
• Password: Corresponding password for the user.
Install Apache Webserver on Ubuntu
1. Install Apache2 (Web Server)
sudo apt install apache2
• Installs Apache2, a widely used web server.
• sudo gives administrative privileges.
• apt install installs the package from Ubuntu's repository.
2. Start Apache2 Service
sudo systemctl start apache2
• Starts the Apache2 service so it can serve web pages.
• Doesn't enable it to start automatically on reboot.
3. Enable Apache2 to Start on Boot
sudo systemctl enable apache2
• Ensures Apache2 starts automatically when the system reboots.
• Prevents you from having to manually start it each time.
4. Check Apache2 Status
sudo systemctl status apache2
• Displays whether Apache2 is active (running) or inactive (stopped).
• Useful for debugging if the web server is not responding.
5. Check Firewall (UFW) Status
sudo ufw status
• Shows whether the Uncomplicated Firewall (UFW) is active.
• Lists allowed and blocked ports/services.
6. Install UFW (Firewall)
sudo apt install ufw -y
• Installs ufw (Uncomplicated Firewall), a simple way to manage firewall rules.
• The -y flag automatically confirms installation.
7. Enable UFW Firewall
sudo ufw enable
• Activates the firewall to protect the system.
• Blocks all unauthorized traffic by default.
8. Allow Apache2 Through the Firewall
sudo ufw allow 'Apache'
• Allows Apache2 traffic (HTTP on port 80, HTTPS on 443).
• Necessary if you want external devices to access your web server.
9. Restart Apache2
sudo systemctl restart apache2
• Restarts Apache2 after making changes to its configuration.
• Useful when updating settings in /etc/apache2/apache2.conf.
10. Check Network Configuration (Find Your IP Address)
ip a
• Shows network interface details, including IP addresses.
• Look for an inet entry (e.g., 192.168.1.100 or 172.22.141.251).
11. Access Apache2 in a Browser
http://172.22.141.251
• Opens Apache2 in a web browser by using the server's IP address.
• If accessing from localhost, use:
http://localhost
• If not working, check:
sudo systemctl status apache2