[Solved] UFW Not Behaving Properly

Kernels & Hardware, configuring network, installing services

[Solved] UFW Not Behaving Properly

Postby supusr » 2020-05-20 20:59

I have installed ufw, but when I try to enable it in the terminal as root I get: bash: ufw: command not found
I have tried uninstalling and reinstalling, to no avail. Any ideas?
Last edited by supusr on 2020-05-21 02:47, edited 1 time in total.
supusr
 
Posts: 29
Joined: 2016-11-09 20:07

Re: UFW Not Behaving Properly

Postby Hallvor » 2020-05-20 21:30

Not found means not found, as in perhaps having a different path than the non-root user.

Try executing the command with the full path, for instance /usr/sbin/ufw status verbose
Lenovo ThinkPad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Buster (KDE)
Lenovo ThinkPad X240, Intel Core i5-4300U CPU @ 2.90GHz, 8 GB RAM, 120 GB SSD, Debian Buster (KDE)
User avatar
Hallvor
 
Posts: 1086
Joined: 2009-04-16 18:35
Location: Norway

Re: UFW Not Behaving Properly

Postby eriefisher » 2020-05-20 23:31

Code: Select all
su
password
ufw enable


You need to be root. ufw also requires an argument/option. Running just ufw does nothing.
____________________________________________
There's a manual?
Siduction
Debian Sid
Xfce4 4.14
User avatar
eriefisher
 
Posts: 130
Joined: 2008-06-04 03:49
Location: Ontario's South Coast

[Solved] Re: UFW Not Behaving Properly

Postby supusr » 2020-05-21 02:46

I'm marking my own post solved because I got it working. Turns out that typing ufw enable (even as root) does not work. I must use sudo. I added myself to sudo and then used sudo ufw enable and it works. Not sure what was going on but it is working now. Thanks for the input.
supusr
 
Posts: 29
Joined: 2016-11-09 20:07

Re: UFW Not Behaving Properly

Postby cuckooflew » 2020-05-21 02:49

===edited because we posted almost the same time.
Turns out that typing ufw enable (even as root) does not work. I must use sudo.

Yes it does work as root, but using "sudo" works as well, it did not work as root, because you did not use 'su -' , just using 'su' does not put you in the correct path to correctly,
Postby Hallvor » 2020-05-20 21:30
Not found means not found, as in perhaps having a different path than the non-root user.

Try executing the command with the full path, for instance /usr/sbin/ufw status verbose

====
Postby eriefisher » 2020-05-20 23:31


Code: Select all
su
password
ufw enable

Noooo, that will not work anymore.
It should be :
Code: Select all
su -
password
pwd (to see what dir you are in, it will be root)
)
ufw enable

Note pay attention to the - in su , su - , .....probably this is why it does not work for you.
I use 'pwd' , often you may want to cd to the directory you want to be working in, I don't think for ufw that will be necessary, Some times reading the manual is helpfull, eg 'man su'
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

Re: UFW Not Behaving Properly

Postby supusr » 2020-05-21 14:23

cuckooflew wrote:===edited because we posted almost the same time.
Turns out that typing ufw enable (even as root) does not work. I must use sudo.

Yes it does work as root, but using "sudo" works as well, it did not work as root, because you did not use 'su -' , just using 'su' does not put you in the correct path to correctly,
Postby Hallvor » 2020-05-20 21:30
Not found means not found, as in perhaps having a different path than the non-root user.

Try executing the command with the full path, for instance /usr/sbin/ufw status verbose

====
Postby eriefisher » 2020-05-20 23:31


Code: Select all
su
password
ufw enable

Noooo, that will not work anymore.
It should be :
Code: Select all
su -
password
pwd (to see what dir you are in, it will be root)
)
ufw enable

Note pay attention to the - in su , su - , .....probably this is why it does not work for you.
I use 'pwd' , often you may want to cd to the directory you want to be working in, I don't think for ufw that will be necessary, Some times reading the manual is helpfull, eg 'man su'



Sounds like I need to learn some more about how sudo works in Debian. Thanks for the comments from the Debian community forum. My sudo and my ufw are both working now.
supusr
 
Posts: 29
Joined: 2016-11-09 20:07


Return to System configuration

Who is online

Users browsing this forum: No registered users and 10 guests

fashionable