run gufw Firewall on startup without password?
  • spartanspartan
    PMPosts: 18


    Hi all, I have a question on gufw Firewall.


    My LXLE 12.04.4 Revisited PC automatically runs gufw on startup, that is set from Menu > Preferences > Default application for LXSession. When gufw launched, it requires me to enter the password.


    I have another PC running LXLE 12.04 (not Revisited) used by my kids.
    I need to make gufw automatically run on startup, without my kids having to manually enter superuser's (my own account's) password.

    It's related to NOPASSWD tag in the sudoers file. I read http://www.sudo.ws/sudo/sudoers.man.html, but don't quite understand the syntax of the command for this purpose.

    Would anyone please give me suggestion on how I do this?
    Thanks in advance~ :)

    LXLE revives my old machines~ #happy :)
  • lxlelxle
    PMPosts: 2,656
    I don't understand what you mean by run, the firewall is either on or off, there is no reason to run it.
  • spartanspartan
    PMPosts: 18
    How do I check whether the firewall is on or off?
    LXLE revives my old machines~ #happy :)
  • lxlelxle
    PMPosts: 2,656
    to check the state of the firewall you need to click on unlock of gufw and enter the password. gufw will always report the firewall as off before unlock regardless of whether its actually on or not.
  • spartanspartan
    PMPosts: 18
    I just tested: 'sudo ufw status' using my own (superuser) account, and the status is: active.

    But, when I used my kid's account, 'sudo ufw status' command was rejected with an error message saying:
    'kidname is not in the sudoers file'. When I used 'su' in order to run the command as root, my password was rejected too.

    I'm still not sure whether the firewall is active or not when my kid uses her own account.

    LXLE revives my old machines~ #happy :)
  • lxlelxle
    PMPosts: 2,656
    menu>preferences>firewall configuration
  • spartanspartan
    PMPosts: 18
    Thanks lxle, but that's the usual way I run gufw. Everytime I execute gufw using this way, the firewall is always inactive and I have to type the superuser's password to activate it.

    Please excuse me if I was not clear. 
    Here I'm asking whether there's another way to automatically run the Firewall on startup, without user having to input the password.

    Thanks again for your help :)
    LXLE revives my old machines~ #happy :)
  • lxlelxle
    PMPosts: 2,656
    This is what I'm trying to explain to you. When you open gufw, it will always report inactive, even if its on. It doesn't report the true state of the firewall until you unlock it.

    In other words, if i turn on my firewall right now with gufw, then close the program and reopen it, it will report thats its off, even though its on. Why? because I haven't 'unlocked' gufw to see the true state of the firewall.
    Thanked by 1spartan
  • spartanspartan
    PMPosts: 18
    Oh I understand now.
    So when my kid is logging on, the firewall is automatically active without having to run gufw, am I not mistaken?

    Thanks for your help, LXLE~ :)
    LXLE revives my old machines~ #happy :)
  • lxlelxle
    PMPosts: 2,656
    right, whether its on or off, without unlocking it first it will always report off even if its on. In other words, if you opened gufw and click unlock, then turned it on. It's then on, until you repeat the same process and turn it off. Simply opening gufw will aways show off, until you click unlock which will then display the true state of the firewall.