Skip to main content
31 votes

Why does Debian come without a firewall enabled by default?

First, Debian tends to assume you know what you are doing, and tries to avoid making choices for you. The default install of Debian is fairly small and is secure — it doesn't start any services. And ...
Faheem Mitha's user avatar
  • 35.3k
30 votes

How can I enable ufw automatically on boot?

It would've been very useful if you had mention at least what the distribution is or the version of the package that you are using. However if you are running systemd try this: sudo systemctl enable ...
imaginois's user avatar
  • 401
17 votes
Accepted

UFW/IPTABLES not blocking DHCP UDP port 67?

I was too dump to open up the proper ports on my firewall before I started testing out my shiny new DHCP server, and it took a moment to dawn on me that it shouldn't work yet. I never opened port 67 ...
sourcejedi's user avatar
15 votes

Best way to disable SSH for all users?

Ubuntu 16.04 LTS uses systemd, which means you want systemctl. To prevent the service from starting automatically at boot time, use sudo systemctl disable ssh.service To stop currently running one, ...
Sergiy Kolodyazhnyy's user avatar
14 votes
Accepted

Allow access to Apache on both port 80 and 443 in Ubuntu 16.04

You are likely receiving that error because there has not been a profile created for 'Apache Full'. You can see which profiles exist on your system by checking the directory: /etc/ufw/applications.d/...
Jeff's user avatar
  • 920
12 votes

Why does Debian come without a firewall enabled by default?

First off, I do want to repeat what has already been said: Debian caters to a rather different group of users than many other mainstream distributions, particularly so Ubuntu. Debian is geared toward ...
user's user avatar
  • 29.2k
10 votes

How should i enable UFW: through "systemctl enable" or "ufw enable"?

If you do ufw enable, systemctl disable ufw and then reboot the system, what is the ufw status verbose output after the reboot? I'm guessing that it will be inactive. If that's true, then the ...
telcoM's user avatar
  • 99.4k
10 votes
Accepted

UFW blocks DHCP

sudo ufw allow bootps sudo ufw allow 53/udp sudo ufw allow 53/tcp
oscar's user avatar
  • 341
9 votes

UFW: Allow traffic only from a domain with dynamic IP address

Based on previous answers I updated the following as bash script that works on Debian Jessie #!/bin/bash HOSTNAME=dynamichost.domain.com LOGFILE=$HOME/ufw.log Current_IP=$(host $HOSTNAME | head -n1 | ...
Mattias Pettersson's user avatar
9 votes
Accepted

Where are the logs for UFW located on Arch Linux?

If there is no additional logger configured, all UFW events should be logged to systemd journal by default. UFW entries have the following format: Sep 13 21:52:11 xps kernel: [UFW BLOCK] IN=wlp58s0 ...
rkiyanchuk's user avatar
9 votes

How to run graphical applications as root under wayland

In Wayland, other users cannot start applications because they cannot access the Wayland socket file located at $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY.  However, root ignores all file permissions and so ...
S. Chauveau's user avatar
7 votes

ufw logs too much stuff, how can I disable that?

Ubuntu's Community Help Wiki page on UFW has information on toggling logging if you'd like to disable it completely. The man page on UFW has much better information on it, which provides more advanced ...
Kenneth B. Jensen's user avatar
7 votes

How can I enable ufw automatically on boot?

For me, this was a conflict with firewalld, and was resolved with sudo systemctl disable firewalld
Tim Sylvester's user avatar
7 votes
Accepted

ufw "command not found"- but as the root user!

This is an expected behavior in Debian. nethogs full path is /usr/sbin/nethogs. Non-root user in Debian does not have /usr/sbin in its default $PATH. With command su you become a root, but the ...
ethcz's user avatar
  • 365
6 votes

UFW: Allow traffic only from a domain with dynamic IP address

Based on all answers before I combined them. No logfile needed. Tested on Ubuntu 18.04 #!/bin/bash HOSTNAME=YOUR.DNS.NAME.HERE if [[ $EUID -ne 0 ]]; then echo "This script must be run as root" ...
Sebastian's user avatar
6 votes

Why does Debian come without a firewall enabled by default?

If I were to guess, without actually being in the head of a generation of Debian developers and maintainers, my guess would be this: Debian is primarily designed as a server operating system, both ...
Lizardx's user avatar
  • 3,068
5 votes

UFW is blocking DNS

Firstly ufw allow dns allows ingoing DNS requests, which is not what you want. Secondly you can follow all commands mentioned in other answers (most easily ufw allow out 53), but order matters. So if ...
rugk's user avatar
  • 3,136
5 votes
Accepted

Passing PAM parameters to UFW

Ok. My problem was that $PAM_RHOST returns hostname not ip. Corrected script #!/bin/sh ip=$(getent hosts "$PAM_RHOST" | awk '{ print $1 }') if [ "$PAM_TYPE" = "close_session" ]; then ufw delete ...
Evus's user avatar
  • 181
5 votes

Why does Debian come without a firewall enabled by default?

The general idea is, you should not need a firewall on most systems except for complex setups. SSH is running,, when you installed a server. Nothing else should be listening and you probably want to ...
allo's user avatar
  • 946
5 votes
Accepted

Opening port not working

Your netstat output shows you the problem: tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN 743/python Specifically, 127.0.0.1:8000 shows that your web server is bound ...
DopeGhoti's user avatar
  • 76.7k
5 votes

ufw blocks wireguard

By default, ufw will apply rules to all available interfaces. To limit this, specify DIRECTION on INTERFACE, where DIRECTION is one of in or out (interface aliases are not supported). For ...
Uwe's user avatar
  • 51
5 votes

UFW not allowing to boot debian 11

People experiencing this problem can adjust /lib/systemd/system/ufw.service to have: [Unit] Description=Uncomplicated firewall Documentation=man:ufw(8) #DefaultDependencies=no #Before=network.target ...
jdstrand's user avatar
4 votes

How can I enable ufw automatically on boot?

You could add the enable command to your rc.local script which runs on startup. For Debian, it's located in /etc/rc.local For Ubuntu, it's also located in /etc/rc.local For Fedora, it's located in /...
Amir Amini's user avatar
4 votes

Why does Debian come without a firewall enabled by default?

Are people expected to connect to the Internet before yes getting a firewall? Even if all ports are closed by default Sorry, they are not. rpcbind seems to be installed, enabled, and listening on ...
sourcejedi's user avatar
4 votes

How to block traffic to a different host using UFW on a router

Turns out that the route keyword is needed to make a rule that applies to forwarding. Hence: ufw route deny in on $WAN_INTERFACE to any proto tcp
hsivonen's user avatar
  • 141
4 votes
Accepted

GUFW returns a segmentation fault in line 13

Type the following command in a terminal: echo $XDG_SESSION_TYPE If it returns Wayland, type: xhost si:localuser:root to allow root to start graphical apps under Wayland sessions.
Exercise To The Reader's user avatar
4 votes

Allow access to Apache on both port 80 and 443 in Ubuntu 16.04

Instead of ufw allow "Apache Full" you should use, ufw allow "WWW Full" You have to look in your /etc/ufw/applications.d/ dictionary which file is available. Maybe it is called ...
doLife's user avatar
  • 41
4 votes

Can't log in via SSH after reboot!

Check ssh status: # systemctl status ssh If the service is "disabled": # systemctl enable ssh #enable run on startup # systemctl start ssh #start it right now If you get some error on why it ...
pormulsys's user avatar
  • 135

Only top scored, non community-wiki answers of a minimum length are eligible