• Home
  • WordPress
  • web Hosting
    • Free hosting
    • Cheap Hosting
    • comparison cloud , vps, shared, wordpress
    • managed wordpress hosting
    • managed cloud hosting
  • page Speed
  • Deals
  • Services
  • About

RAaz Kumar .com

wordpress tutorials seo hosting etc


ufw firewall commads allow port enable disable ubuntu 20.04

ufw commands

allow, disable, enable, status, applist
sudo ufw allow ssh/tcp
$ sudo ufw logging on
$ sudo ufw enable
$ sudo ufw status
IPtables rules vanished after reboot. but install persistent
rate limiting
ufw limit SSH  6r/30s
ufw will normally allow the connection but will deny connections if an IP address attempts to initiate six or more connections within thirty seconds
firewall install activate
sudo apt-get install ufw

ufw status inactive

don;t unable unless you have added the rules
sudo ufw enable
root@-s-4vcpu-8gb-blr1-01:~# ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
Firewall is active and enabled on system startup
enable on reboot
sudo ufw status verbose
sudo ufw help
root@instance-1:~# sudo ufw status verbose
Status: inactive
root@instance-1:~# sudo ufw app list
Available applications:
  OpenSSH

UFW Allow Port

sudo ufw allow 80
sudo ufw allow 22
sudo ufw allow 443
sudo ufw allow 3306
sudo ufw allow 9000
sudo ufw allow 6379  //redis
         ufw allow 80/tcp
sudo ufw allow 80 && sudo ufw allow 22 && sudo ufw allow 443 && sudo ufw allow 3306 && sudo ufw allow 9000 && sudo ufw allow 6379
port 9000

UFW Allow service nginx apache etc

port 80 automatically adds above services
The profiles are kept in /etc/ufw/applications.d
root@-s-4vcpu-8gb-blr1-01:~# sudo ufw allow ‘Nginx HTTP’
ERROR: Could not find a profile matching ‘Nginx HTTP’

sudo ufw app list

sudo ufw allow nginx

root@-s-4vcpu-8gb-blr1-01:~# ls /etc/ufw/applications.d
openssh-server

cat /etc/ufw/applications.d/openssh-server

root@-s-4vcpu-8gb-blr1-01:~# cat /etc/ufw/applications.d/openssh-server
[OpenSSH]
title=Secure shell server, an rshd replacement
description=OpenSSH is a free implementation of the Secure Shell protocol.
ports=22/tcp

root@-s-4vcpu-8gb-blr1-01:~# sudo ufw app list
Available applications:
OpenSSH

UFW Block Port

sudo ufw deny out 25
sudo ufw allow 21

UFW Block All Ports except allowed

to see open ports in linux
sudo lsof -i -P -n | grep LISTEN
to see incoming connections linux
netstat -an | grep ‘LISTEN’
netstat -natu | grep ‘ESTABLISHED’

Delete UFW rule

sudo ufw status numbered
sudo ufw delete 5
sudo ufw delete deny 22

ufw rules

root@-s-4vcpu-8gb-blr1-01:~# ufw status
Status: active

To Action From
— —— —-
80 ALLOW Anywhere
22 ALLOW Anywhere
443 ALLOW Anywhere
3306 ALLOW Anywhere
9000 ALLOW Anywhere
6379 ALLOW Anywhere
22/tcp ALLOW Anywhere
80 (v6) ALLOW Anywhere (v6)
22 (v6) ALLOW Anywhere (v6)
443 (v6) ALLOW Anywhere (v6)
3306 (v6) ALLOW Anywhere (v6)
9000 (v6) ALLOW Anywhere (v6)
6379 (v6) ALLOW Anywhere (v6)
22/tcp (v6) ALLOW Anywhere (v6)

rate limiting linux with ufw

cat /etc/ufw/after.rules
cat /etc/ufw/before.rules
nano /etc/ufw/after.rules
# Limit connections per IP
-A ufw-http -m state –state NEW -m recent –name conn_per_ip –set
-A ufw-http -m state –state NEW -m recent –name conn_per_ip –update –seconds 10 –hitcount 45 -j ufw-http-logdrop

ufw configuration file to save changes permanently

Prior to running the rules input through the terminal, UFW will run a file, before.rules
cat /etc/ufw/before.rules
cat /etc/ufw/after.rules (if any changes made via terminal)
ipv6 rules
after6.rule
before6.rules
/etc/ufw/user.rules
also check in /lib/ufw/user.rules
UfW is frontend for iptables, so iptables-save and iptables-restore would work fine with it.
ufw status numbered
ufw delete NUM
is ufw interfere with iptables
No,
ufw log errors configuration
sudo ufw logging on
/var/log/ufw.log
Sep 16 15:08:14 <hostname> kernel: [UFW BLOCK] IN=eth0 OUT= MAC=00:00:00:00:00:00:00:00:00:00:00:00:00:00 SRC=123.45.67.89 DST=987.65.43.21 LEN=40 TOS=0x00 PREC=0x00 TTL=249 ID=8475 PROTO=TCP SPT=48247 DPT=22 WINDOW=1024 RES=0x00 SYN URGP=0
The initial values list the date, time, and hostname of your Linode. Additional important values include:
[UFW BLOCK]: This location is where the description of the logged event will be located. In this instance, it blocked a connection.
IN: If this contains a value, then the event was incoming
OUT: If this contain a value, then the event was outgoing
MAC: A combination of the destination and source MAC addresses
SRC: The IP of the packet source
DST: The IP of the packet destination
LEN: Packet length
TTL: The packet TTL, or time to live. How long it will bounce between routers until it expires, if no destination is found.
PROTO: The packet’s protocol
SPT: The source port of the package
DPT: The destination port of the package
WINDOW: The size of the packet the sender can receive
SYN URGP: Indicated if a three-way handshake is required. 0 means it is not.
sudo ufw logging low|medium|high,

sudo ufw app list

root@-s-4vcpu-8gb-blr1-01:~# sudo ufw app list
Available applications:
  OpenSSH
sudo ufw deny 21
sudo ufw enable
sudo ufw disable
sudo ufw status
sudo ufw allow ssh
To additionally let in HTTP and HTTPS traffic, we can allow the “WWW Full” application profile:
ERROR: Could not find a profile matching ‘Nginx HTTP’
– sudo ufw allow ‘WWW Full’
sudo ufw allow ‘WWW Full’
If ip tables firewall
sudo iptables -S
sudo iptables -S
 netstat -tlpn
netstat -tlpn
sudo iptables -L -n
service vsftpd stop
/etc/init.d/ssh restart
check ssh2 php support
php -m |grep ssh2
install
aptitude install libssh2-1-dev libssh2-php
apt-get
sudo service iptables stop
sudo ufw disable
– sudo ufw allow ‘Nginx HTTP’
You can verify the change by typing:
– sudo ufw status
– /etc/default/ufw : This is main ufw config file for default policy and kernel modules.
cat /etc/default/ufw
– /etc/ufw/before.rules : Rules in these files are calculate before any rules added via the ufw command.
– /etc/ufw/after.rules : Rules in these files are calculate after any rules added via the ufw command.
/etc/ufw/sysctl.conf
etc/ufw/user.rules
https://www.digitalocean.com/community/tutorials/how-to-setup-a-firewall-with-ufw-on-an-ubuntu-and-debian-cloud-server

ufw logging high

ufw logging off
ufw logging low
sudo netstat -tlpn
sudo iptables -S

UFW Allow mail server

sudo ufw deny out 25  (block outgoing mails)
sudo ufw allow 25 (incoming)
sudo ufw allow 143
Actually, iptables is the real firewall and ufw is only a interface to configure the iptables. I don’t know if there is a way to do it using ufw, maybe other user knows it.
sudo iptables -A INPUT -p tcp –destination-port 22 -m mac –mac-source <Mac_address> -j ACCEPT
sudo iptables -A INPUT -p tcp –destination-port 22 -m mac –mac-source 3C:1E:04:28:16:5A -j ACCEPT
netstat -plnt
Active Internet connections (only servers)
lsof -i :
sudo netstat -plant | grep LISTEN

pam_unix(sshd:auth): check pass; user unknown
Apr 21 06:03:18 -s-4vcpu-8gb-blr1-01 sshd[16902]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=80.98.249.181

The result is RESULT.
Apr 21 06:58:43 -s-4vcpu-8gb-blr1-01 kernel: [UFW BLOCK] IN=eth0 OUT= MAC=a6:01:3e:6a:96:b1:fe:00:00:00:01:01:08:00 SRC=45.146.165.129 DST=128.199.25.144 LEN=40 TOS=0x00 PREC=0x00 TTL=249 ID=46620
PROTO = The protocol used by the attempted connection.

ufw allow ssh out
sudo ufw allow from 203.0.113.4 to any port 22
sudo ufw allow from 15.15.15.0/24 to any port 22

Related topics:

  1. Ip tables / ufw / firewall d commands for block port ip rate limiting
  2. change ssh port in linux – avoid sshd ddos attacks
  3. mysql restart ubuntu status start stop in linux windows reload
  4. how to uninstall package in linux ubuntu rpm, yum apt-get
  5. memcached install ubuntu wordpress

tutorials

  • Vivek Bindra Videos Transcription (business strategy)
  • git commands
  • new relic php agent install in 3 steps
  • new relic mysql install integration - 2 ways fix problems
  • new relic installation linux (infrastructure agent , php, mysql , nginx)
  • xampp tutorials 2021 installation errors fix wordpress phpmyadmin mysql apache
  • Redis performance metrics & tuning for nginx apache ubuntu & debian
  • Devops course Syllabus topics PDF AWS, Azure, cisco, redhat
  • CCNA Syllabus pdf (CCNA / CCNP vs devops vs mcsa /MCSE)
  • how to create a website free of cost on google
  • what is vpn vs proxy vs tor, http vs https, http2, tcp vs udp, kali linux sql source code injection
  • nginx server tutorials (installation, configuration, performance tuning, security)
  • MySQL Tutorial (create,connect database, update tables, export etc) Documentation & TIPS
  • AUdio Editing Background Noise removal (Audacity, Adobe Premiere Addition, Camtasia Filmora Windows Obs)
  • Android Studio tutorials syllabus Topics Course details #AndroidApplicationDevelopment
  • [INTRO] Ethical hacking / cyber Security / Penetration testing Tutorial -{updates frequently}
  • redis install ubuntu 20.04 with wordpress php redis mysql configuration
  • ubuntu tutorials installation download issues etc
  • Php tutorials
  • HTML & CSS Tutorials
  • Core Java Tutorial Free online
  • Linux sysadmin tutorials linux system administrator
    • linux security limits.conf deciding user limits process limits for nginx server
    • remove repository ubuntu
    • increase open file limit linux File descriptor ft nginx , mysql, lemp
    • how to uninstall package in linux ubuntu rpm, yum apt-get
    • rsync command linux with examples comparison to scp
    • check linux version (lsb_release -a) ubuntu debian 32 or 64 bit
    • memcached install ubuntu wordpress
    • ping command
    • change ssh port in linux - avoid sshd ddos attacks
    • ddos attack prevention
    • ufw firewall commads allow port enable disable ubuntu 20.04
    • red hat linux certification cost jobs salary syllabus courses fees
    • ulimit linux unlimited command unlimto set & know user limits open files file descriptor max user process etc.
    • top 10 apt & apt-get commands (most used) apt vs apt-get
    • linux sysctl command tweaks & hardening
    • linux system specs commands (CPU, Memory, Disk )speed, type. manufacture
    • 3 Ways (SCP, rsync, Sftp) linux server migration between two remote server apache nginx
    • Upgrade Ubuntu from 18.04 (19.10) to 20.04 LTS command line or gui server | desktop
    • lsof netstat commands to know listening ports in linux 3 ways
    • Top 10 GREP Commands in linux to search files directory words strings
    • TOP 10 mv & cp commands in linux to move & copy files in Linux
    • Top 10 zip / tar commands to compress & extract files in linux
    • Ip tables / ufw / firewall d commands for block port ip rate limiting
    • Top 10 most used Cat commands with examples (create, view, append files)
    • linux performance tuning inode limit file descriptors tco, kernel etc
    • linux commands pdf (files & Directories, zip & unzip process, search etc)
  • apache server tutorial (install,config, performance tuning, security, error handling)

 

 

wordpress Pagespeed optimization

Digitalocean free $100 Credit

Cloudways Review pricing promo codes

Siteground cpu limits Pricing

Shared Hosting

Managed wordpress Hosting

Managed Hosting Cloud server

VPS Hosting

Cloud Hosting – Unmanaged

Google cloud Pricing

Aws Pricing

Azure pricing

nginx server tutorials

apache server tutorials

linux sysadmin tutorials

mysql Commands list pdf

LEMP Install Ubuntu

Mysql Performance Tuning

Nginx Performance tuning

Linux Performance tuning

Php -fpm performance tuning

Redis Performance tuning

linux server security

nginx security best practices

wordpress security plugins

 

 

wordpress

 

Top 5  WP Google Analytics Plugins

WP Backup Plugins

Wp Comment Plugins

Top wordpress Security Plugins

WP Seo Plugins

WP Caching Plugins

Best Adsense Plugins for WordPress

Wp social Sharing Plugins

autoshare social media plugins

WP speed Optimization Plugins

Speedup WordPress google Score

More Wp tuts

Server Admin Cloud

 

Installing Nginx LEMP On ubuntu

Installing apache Lamp ubuntu

nginx fastcgi cache enable

php – fpm install  & Configuration

Opcache install & Configure

php -fpm pool manager explained

Mysql Install & Configuration

Redis Object cache install & configure

 

Nginx as Reverse Proxy and Load balancer

Load Balance / auto scaling in google cloud

Linux Commands PDF

Mysql Commands Pdf

Letsencrypt tutorial

mysqldump export & import 

Pagespeed Module install & configure

nginx.conf best file

mysql.conf best file

upgrade ubuntu

© 2023 - All Rights Reserved Disclaimer & Privacy Policy