باز کردن پورت در فایروال اوبنتو UFW

Open a Port in UFW

1. Log into SSH as root.
2. Check if the application port is defined as a service (e.g. OpenVPN, PostgreSQL, IRC):

cat /etc/services | grep service-name

Or

cat /etc/services | grep port

To navigate the full list, use Page Up, Page Down, and arrow keys after using the less command:

less /etc/services

3. If the service is listed, you can open the port using the service name (TCP/UDP protocol optional):

sudo ufw allow servicename

sudo ufw allow servicename/tcp

4. If there is no service listed for the port, you can open the port by specifying the port and protocol (TCP/UDP):

sudo ufw allow 10000

sudo ufw allow 1352/udp

5. If you need to allow all connections from a specific system or network IP address:

sudo ufw allow from 1.2.3.4

6. To allow all connections from a specific IP subnet:

sudo ufw allow from 1.2.3.0/24

7. To allow connections on a specific port from an IP address:

sudo ufw allow from 1.2.3.4 to any port 22

8. After you open a port in UFW, ensure UFW is enabled:

sudo ufw enable

Check Open Ports in UFW

After making changes to any firewall, you should verify your changes to ensure they’re correct and active.

1. To check whether UFW is running:

sudo ufw status

2. To check whether UFW is running with additional information such as logging and profile status:

sudo ufw status verbose

3. To find the rule number for UFW rules:

sudo ufw status numbered

4. Then you can remove the rule:

sudo ufw delete 1

  • firewall, ufw, port, ubuntu, linux
  • 0 Benutzer fanden dies hilfreich
War diese Antwort hilfreich?

Verwandte Artikel

فعال سازی روت در اوبنتو

کاربر روت در نسخه های جدید سیستم عامل های لینوکس اوبنتو غیر فعال شده است و این کار باعث شده که...

آموزش تغییر پسورد سرور مجازی لینوکس

این مقاله به شما آموزش می دهد چگونه پسورد روت سرور Ubuntu و یا CentOS خود را از طریق محیط ترمینال...

پیکربندی آدرس IP استاتیک بروی سرور اوبونتو 16.04

جهت تنظیم و ست کردن آی پی استاتیک برروی سرور لینوکس اوبنتو مراحل زیر را انجام دهید: مرحله 1-...

نمایش مشخصات منابع لینوکس

ابزار مانیتورینگ لینوکس جهت مشاهده مشخصات مانند میزان رم، سی پی یو و هارد در لینوکس (Centos ,...

ریستارت کردن سرور لینوکس به صورت خودکار

ریستارت کردن سرور لینوکس به صورت خودکار توسط Cron به کمک سرویس crontab که در تمامی نسخه های...