Everything works up to sudo ufw enable .
This triggers an error starting with
ERROR: problem running ufw-init
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.0-19041-Microsoft/modules.dep.bin'
Looking up the errors does not give encouraging results. It appears ufw does not function with WSL.
This link: askubuntu.com/questions/1100739/i-... even concludes (about ufw on WSL) that "Some tools are really not portable to different platforms".
I read a stackoverflow post (stackoverflow.com/questions/660185... ) saying "Just let the Windows Firewall do its job if you are concerned about external access to the Nginx. " But no clues as to how to do this.
Everything works up to
sudo ufw enable.This triggers an error starting with
Looking up the errors does not give encouraging results. It appears ufw does not function with WSL.
This link: askubuntu.com/questions/1100739/i-... even concludes (about ufw on WSL) that "Some tools are really not portable to different platforms".
I read a stackoverflow post (stackoverflow.com/questions/660185... ) saying "Just let the Windows Firewall do its job if you are concerned about external access to the Nginx. " But no clues as to how to do this.
I'm using Ubuntu 18.04
I had the same issue and this resolved it:
Run:
sudo nano /usr/lib/python3/dist-packages/ufw/util.pyReplace under_ssh function with
def under_ssh(pid=None):
'''Try to determine if we are being run from an ssh session'''
if pid is None:
pid = str(os.getpid())