Skip to content

Instantly share code, notes, and snippets.

@kngvamxx
Last active March 18, 2020 13:58
Show Gist options
  • Select an option

  • Save kngvamxx/b6629ea2bfcd0837f2a82d871f227233 to your computer and use it in GitHub Desktop.

Select an option

Save kngvamxx/b6629ea2bfcd0837f2a82d871f227233 to your computer and use it in GitHub Desktop.
installing ftp server
sudo apt-get update
sudo apt install vsftpd
#configure vsftpd-
sudo nano /etc/vsftpd.conf
sudo service vsftpd restart
sudo systemctl status vsftpd
sudo systemctl enable vsftpd
# Configure Firewall
sudo apt-get install ssh
sudo ufw enable
sudo ufw allow 22
sudo ufw allow OpenSSH
# Open port 20 & 21 for FTP
sudo ufw allow 20/tcp
sudo ufw allow 21/tcp
# Open port 40000-50000 for passive FTP
sudo ufw allow 40000:50000/tcp
# Open port 990 for TLS
sudo ufw allow 990/tcp
# Check status
sudo ufw status
# Create FTP User
sudo adduser ftpuser
sudo nano /etc/ssh/sshd_config
-- add the line at bottom [DenyUsers ftpuser]
sudo service sshd restart
# Enable Firewall
sudo ufw enable
# Open a port
sudo ufw allow 22
# Allow port
sudo ufw insert 1 allow 80
#Deny port
sudo ufw deny 22
# Remove or delete rule
sudo ufw delete deny 22
#Allows SSH access from host 192.168.0.2 to any IP address on this host
sudo ufw allow proto tcp from 192.168.0.2 to any port 22
# Replace 192.168.0.2 with 192.168.0.0/24 to allow SSH access from the entire subnet.
Adding the --dry-run option to a ufw command will output the resulting rules, but not apply them. For example, the following is what would be applied if opening the HTTP port:
sudo ufw --dry-run allow http
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment