Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Using the terminal to activate Ufw, fail? Solved.

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
jazzeroo
Posts: 12
Joined: 2022-05-23 19:06

Using the terminal to activate Ufw, fail? Solved.

#1 Post by jazzeroo »

I am new to linux and I am not used to using the terminal either but I am trying to learn by running Debian
in a VM however I am trying to activate the uncomplicated firewall (ufw) by following the steps here:
https://wiki.debian.org/Uncomplicated%2 ... 0%28ufw%29

But when I do this I cannot tell if anything is happening because when I type the (# ufw status verbose) command nothing happens.
I have tried to do this several times but I am not able to make it work even though I am typing it exactly as the
guide page is showing, can anyone tell me why it isnt working?
Last edited by jazzeroo on 2022-05-29 14:16, edited 1 time in total.

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2029
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 139 times
Been thanked: 206 times

Re: Using the terminal to activate Ufw, fail?

#2 Post by Hallvor »

So you executed all these commands, and the latter showed no output?

# apt install ufw
# ufw enable
# ufw default deny incoming
# ufw default allow outgoing
# ufw status verbose
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

jazzeroo
Posts: 12
Joined: 2022-05-23 19:06

Re: Using the terminal to activate Ufw, fail?

#3 Post by jazzeroo »

Yes that is right and the terminal didn't respond through the process though it didnt seem to be anything wrong with it,
and virtualbox asked me if I wanted to save the VMs current status or something like that so something probably happende but I couldn't see it.

jazzeroo
Posts: 12
Joined: 2022-05-23 19:06

Re: Using the terminal to activate Ufw, fail?

#4 Post by jazzeroo »

I tried this again today and it still doesn't work for me the way it says on debian.org so I looked around and on askubuntu.com
https://askubuntu.com/questions/1340484 ... -not-found
Somone said to another user to type sudo apt install ufw
so I tried this and finally I got a reaction from the terminal and it installed Ufw but the next command from debian.org # ufw enable still isnt doing anything, so what is up with this am I missing something or is the guide page incorrect? Maybe it assumes that I know that I should do something else first? (If it is assuming that it is wrong btw, if thats not obvious).

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: Using the terminal to activate Ufw, fail?

#5 Post by dilberts_left_nut »

What are you expecting it to do?
AdrianTM wrote:There's no hacker in my grandma...

jazzeroo
Posts: 12
Joined: 2022-05-23 19:06

Re: Using the terminal to activate Ufw, fail?

#6 Post by jazzeroo »

I expect it to do what it says in the guide,

Next, it is recommended to verify that the firewall is enabled by typing:

# ufw status verbose

Note: With this command you will also be able to see all of the defaults and rules which you have applied.


But it doesn't when I type it like that, but it worked when i wrote sudo ufw enable
and sudo ufw status verbose instead.

jazzeroo
Posts: 12
Joined: 2022-05-23 19:06

Re: Using the terminal to activate Ufw, fail?

#7 Post by jazzeroo »

I just found this in Hallvors guide:
viewtopic.php?f=16&t=150334

The commands are divided in two categories:

$ means that the command should be issued as regular user

# means that the command should be issued as root or with sudo

This is the kind of thing that I meant when I wrote: so what is up with this am I missing something or is the guide page incorrect? As a new Linux user I did not know this.

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: Using the terminal to activate Ufw, fail?

#8 Post by sunrat »

So your issue really had nothing to do with UFW, but rather how to escalate privileges correctly. You should read this too - viewtopic.php?f=16&t=142973
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2029
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 139 times
Been thanked: 206 times

Re: Using the terminal to activate Ufw, fail? Solved.

#9 Post by Hallvor »

We have all been beginners, so don't worry about it. However, please give accurate feedback next time. In the CLI, when you type a command and nothing happens, it usually means that it works.

When I type in - literally - the first command, it says what the problem is:

Code: Select all

hallvor@debian-thinkpad:~$ apt install ufw
E: Klarte ikkje opna låsefila /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
hallvor@debian-thinkpad:~$ ufw enable
bash: ufw: command not found
hallvor@debian-thinkpad:~$
If you had posted the actual CLI output, this problem would be solved in a minute.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

Post Reply