This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Locked myself out of HTTPS to Astaro box

I was setting up some rules and NAT Masq's to foward HTTPS traffic to a webmail server I have behind the Astaro box but I routed all HTTPS traffic to the mail server. Now I cannot access the web GUI! *slaps self* 

Can I change it anywhere on the command line?


This thread was automatically locked due to age.
Parents
  • If you are familiar with an editor like vi, just browse in the commandline to /etc/wfe/conf and edit the file called natmasq.  Make a backup copy first.

    It's a plain text file and just remove the NAT Masq that is giving you problems.

    You might want to reboot after the changes.

    Then to remove a rule, it's a bit more complex.

    From the command line do an "iptables -L | less".  Pay attention to the chain-name at the top of each section.  Go through the rules until you find the offender.  Note the chain-name and which line it is iin within that chain.

    Once you have that information, from the command line type
    "iptables -D  "

    Example..

    iptables -D AUTO_INPUT 1

    Do another "iptables -L" to verify the line you want is gone, then try logging into Web Admin.
Reply
  • If you are familiar with an editor like vi, just browse in the commandline to /etc/wfe/conf and edit the file called natmasq.  Make a backup copy first.

    It's a plain text file and just remove the NAT Masq that is giving you problems.

    You might want to reboot after the changes.

    Then to remove a rule, it's a bit more complex.

    From the command line do an "iptables -L | less".  Pay attention to the chain-name at the top of each section.  Go through the rules until you find the offender.  Note the chain-name and which line it is iin within that chain.

    Once you have that information, from the command line type
    "iptables -D  "

    Example..

    iptables -D AUTO_INPUT 1

    Do another "iptables -L" to verify the line you want is gone, then try logging into Web Admin.
Children
  • Disregard my previous post.

    I played around and found an easy way for you to get in.

    Make a backup copy of /etc/httpd/httpd.conf.

    Use vi and  edit /etc/httpd/httpd.conf changing the line:

    Listen 443

    to something like

    Listen 2456

    Save the configuration, then restart httpd by typing "/etc/init.d/httpd restart" without the quotes.

    Next you'll need to create a couple iptables rules to allow the traffic.  On my firewall the internal interface (eth0) is 192.168.2.1 and the internal network is 192.168.2.0/24 so you'll have to change this for your set up.

    The first rule (using my IPs and port number I entered into httpd.conf):

    iptables -A AUTO_INPUT -p TCP -i eth0 --dport 2456 -s 192.168.2.0/24 -d 192.168.2.1/32 -j ACCEPT

    Next add this rule modified to your IPs, port and ethernet interface:

    iptables -A AUTO_INPUT -p TCP -i eth0 --sport 2456 -s 192.168.2.1/32 -d 192.168.2.0/24 -j ACCEPT

    If you used the same port as I did, in your browser, just enter the IP address followed by a colon and the port.

    In my example:

    https://192.168.2.1:2456

    You should now be able to get into WebAdmin to correct your mistakes.  Once those are correct, reboot the firewall and the two new rules you created and the modifications to httpd.conf will disappear and you'll be back to normal.