Want to subscribe to topics you're interested in?
Become a Member

Suggestion: comment out "iptables -F" in welcome message

Discussion in 'Bug Reports' started by Daniel J. Lewis, Jun 25, 2018.

  1. Daniel J. Lewis

    Daniel J. Lewis Award-winning podcaster and consultant

    100
    11
    18
    Oct 20, 2014
    Ratings:
    +21
    Local Time:
    4:33 PM
    1.8.0
    5.6
    Through some freak accident, I somehow pasted by terminal's entire contents into itself, which included the login welcome message. You know, the one that says, "DO NOT run the below command or you will lock yourself out of the server:" and then it conveniently puts that command on its own line. Thus, my freak accident somehow did run "iptables -F" on my server and locked me out.

    So I know it's a little weird, but I suggest moving that command in line with other text, or else starting that line with "#" so that if someone somehow accidentally copies and pastes that line, they won't run the evil command.
     
    • Agree Agree x 3
  2. eva2000

    eva2000 Administrator Staff Member

    35,099
    7,748
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,948
    Local Time:
    6:33 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    whoops - yes looks like I should comment it out to prevent copy and paste boo-boos :)

    just updated 123.09beta01 with the change so you can update your centmin mod install via cmupdate command

    Upgrading Centmin Mod Code to Latest Version



    Getting Started Guide step 19 outlines also how to keep Centmin Mod code updated or how to switch version branches or you can run cmupdate command that was recently added.

    For 123.09beta01 and higher that means running SSH command = cmupdate and then re-enter /usr/local/src/centminmod and re-run centmin.sh menu.

    For full details read the following links:
     
    Last edited: Jun 25, 2018
  3. eva2000

    eva2000 Administrator Staff Member

    35,099
    7,748
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,948
    Local Time:
    6:33 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    example of updated MOTD display on first login via SSH
    Code (Text):
    ===============================================================================
     - Hostname......: host.domain.com on CentOS Linux 7.5.1804
     - Users.........: Currently 1 user(s) logged on (includes: root)
    ===============================================================================
     - CPU usage.....: 0.00, 0.00, 0.00 (1, 5, 15 min)
     - Processes.....: 31 running
     - System uptime.: 5 days 2 hours 50 minutes 42 seconds
    ===============================================================================
                  total        used        free      shared  buff/cache   available
    Mem:           2048         450        1168         276         429        1416
    Swap:          2048          43        2004
    ===============================================================================
    Filesystem        Type      Size  Used Avail Use% Mounted on
    /dev/ploop36774p1 ext4       50G  4.7G   42G  11% /
    devtmpfs          devtmpfs  1.0G     0  1.0G   0% /dev
    tmpfs             tmpfs     1.0G     0  1.0G   0% /dev/shm
    tmpfs             tmpfs     1.0G  196K  1.0G   1% /run
    tmpfs             tmpfs     1.0G     0  1.0G   0% /sys/fs/cgroup
    tmpfs             tmpfs     205M     0  205M   0% /run/user/0
    
    ===============================================================================
    # ! This server maybe running CSF Firewall ! 
    #   DO NOT run the below command or you  will lock yourself out of the server:
    #
    #   iptables -F
    
    
    ===============================================================================
    * Getting Started Guide - https://centminmod.com/getstarted.html
    * Centmin Mod FAQ - https://centminmod.com/faq.html
    * Change Log - https://centminmod.com/changelog.html
    * Community Forums https://community.centminmod.com  [ << Register ]
    ===============================================================================
    
    ===============================================================================
     Centmin Mod local code is up to date at /usr/local/src/centminmod
     no available updates at this time...
    ===============================================================================
    
     
  4. Daniel J. Lewis

    Daniel J. Lewis Award-winning podcaster and consultant

    100
    11
    18
    Oct 20, 2014
    Ratings:
    +21
    Local Time:
    4:33 PM
    1.8.0
    5.6
    Fantastic!

    I still don't know how I managed to paste my terminal's entire output.

    Since CSF was restarted, is there anything I should do to undo what iptables -F did?
     
  5. eva2000

    eva2000 Administrator Staff Member

    35,099
    7,748
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,948
    Local Time:
    6:33 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    CSF restart should take care everything and repopulate the rules needed for your access.
     
..