Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    CLI commands

    Scheduled Pinned Locked Moved General pfSense Questions
    7 Posts 3 Posters 4.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      nbctcp
      last edited by

      I have few questions on pfsense 2.4.5

      1. how to run setup wizard on console.
      2. I want to change http/https gui from console
        maybe using viconfig on webgui part
        is that possible?
        I tried to change from https to http in webgui viconfig, but after restart GUI not working
      3. how to apply viconfig changes without reboot
        I read somewhere by "rm /tmp/config.cache", but can't found that file.
        what I found is /tmp/cache.lock

      tq

      1 Reply Last reply Reply Quote 0
      • H
        heper
        last edited by

        All those are available from the consolemenu

        1 Reply Last reply Reply Quote 0
        • N
          nbctcp
          last edited by

          1. Logout (SSH only) 9) pfTop
          2. Assign Interfaces 10) Filter Logs
          3. Set interface(s) IP address 11) Restart webConfigurator
          4. Reset webConfigurator password 12) PHP shell + pfSense tools
          5. Reset to factory defaults 13) Update from console
          6. Reboot system 14) Disable Secure Shell (sshd)
          7. Halt system 15) Restore recent configuration
          8. Ping host 16) Restart PHP-FPM
          9. Shell

          Enter an option:
          which menu should I choose if I want to chnage GUI from http to https
          I don't think I should choose #4, because it will reset all my config

          1 Reply Last reply Reply Quote 0
          • H
            heper
            last edited by heper

            option 2

            also: why wouldn't you just change it in the webgui? (system->advanced->admin access)

            N 1 Reply Last reply Reply Quote 0
            • N
              nbctcp @heper
              last edited by

              @heper
              Option2 will change https to http but not vice versa
              Be careful. Most of the time after using Option2, GUI won't work anymore although you can ping the ip
              I need to reset to factory default then "pfctl -d", in order to make it work

              It seems only GUI will give consistent result
              I prefer CLI if possible

              1 Reply Last reply Reply Quote 0
              • S
                serbus
                last edited by serbus

                Hello!

                Option 12 could also be a possibility.
                I am no expert, and hopefully someone will correct me, so dont rely on this...:)

                Once you are at the developer shell :

                parse_config(true);
                $config['system']['webgui']['protocol'] = "https";
                write_config();
                system_reboot_sync();
                exec
                

                Check the developer shell help for more info.

                John

                Lex parsimoniae

                N 1 Reply Last reply Reply Quote 0
                • N
                  nbctcp @serbus
                  last edited by

                  @serbus
                  what command in php shell to reboot webconfigurator because I don't want to reboot system

                  After testing various methods.
                  Only viconfig and php shell work perfectly

                  GOAL: Change Web GUI from http to https
                  OPTION1
                  open http://ipaddress
                  go to System/Advanced/Admin Access
                  STATUS OK

                  OPTION2
                  open gui console
                  8) Shell

                  viconfig

                  change webgui part from http to https

                  /etc/rc.restart_webgui

                  STATUS OK

                  OPTION3
                  open gui console
                  12) PHP shell + pfSense tools
                  parse_config(true);
                  $config['system']['webgui']['protocol'] = "https";
                  write_config();
                  exec
                  exit
                  open gui console
                  11) Restart webConfigurator
                  STATUS OK

                  GOAL: Change Web GUI from https to http
                  OPTION1
                  open http://ipaddress
                  go to System/Advanced/Admin Access
                  go to gui console
                  11) Restart webConfigurator
                  STATUS
                  GUI appeared, type username/password but can't login
                  Shell shown "php-fpm[341]: /index.php: Successful login for user 'admin' from: 10.0.1.1"

                  OPTION2
                  open gui console
                  8) Shell

                  viconfig

                  change webgui part from https to http

                  /etc/rc.restart_webgui

                  STATUS OK

                  OPTION3
                  open gui console
                  12) PHP shell + pfSense tools
                  parse_config(true);
                  $config['system']['webgui']['protocol'] = "http";
                  write_config();
                  exec
                  exit
                  open gui console
                  11) Restart webConfigurator
                  STATUS OK

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.