Welcome to Centmin Mod Community
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

    117
    15
    18
    Oct 20, 2014
    Ratings:
    +33
    Local Time:
    11:53 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.
     
  2. eva2000

    eva2000 Administrator Staff Member

    53,508
    12,132
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,675
    Local Time:
    1:53 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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

    53,508
    12,132
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,675
    Local Time:
    1:53 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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

    117
    15
    18
    Oct 20, 2014
    Ratings:
    +33
    Local Time:
    11:53 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

    53,508
    12,132
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,675
    Local Time:
    1:53 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    CSF restart should take care everything and repopulate the rules needed for your access.