Welcome to Centmin Mod Community
Become a Member

Install Centos7 after install no SSH with Amazon EC2

Discussion in 'Install & Upgrades or Pre-Install Questions' started by matt.king, Aug 27, 2015.

Tags:
  1. matt.king

    matt.king New Member

    6
    0
    1
    Aug 27, 2015
    Ratings:
    +0
    Local Time:
    3:28 PM
    HI all

    I have installed Centos7 (Centos7-201507281409) and can login via ssh no problem with my Amazon .pem key
    Once I install Centmin using the one liner however I lose the ability to SSH in. "connection refused". The first build I did I closed the SSH window as per the install instructions, that was a mistake. :) I had to delete and start over since I totally locked myself out.

    Anyhow, any tips on what might get borked after doing the Centmin install? I looked over the sshd_config file and thought I reverted all the changes but still no luck. Iptables is blank so It appears notthing is blocked, CSF is in test mode.

    Am I missing something dumb?
     
  2. eva2000

    eva2000 Administrator Staff Member

    29,033
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    3:28 PM
    Nginx 1.13.x
    MariaDB 5.5
    if Centmin Mod's CSF Firewall is in test mode, tried waiting 5-10mins and relogging in via SSH could be CSF temp blocking you

    after install check /etc/csf/csf.allow and see if your IP you're connecting from is auto whitelisted.. also could be CSF not detecting your IP properly. If you use dynamic IP and it changes often, see how to whitelist dynamic IPs in CSF Firewall CSF Firewall - CentminMod.com LEMP Nginx web stack for CentOS

    did you change SSHD default 22 port ? manually OR via centmin.sh menu option 16? the latter auto adds the new SSHD default port number to /etc/csf/csf.conf TCP_IN comma separated whitelisted ports and auto removes port 22. If you did it manually, you'd have to manually add your new SSHD default port number to /etc/csf/csf.conf TCP_IN comma separated whitelist and remove port 22 from same listing and then restart CSF Firewall via csf -r command :)
     
    Last edited: Aug 27, 2015
  3. eva2000

    eva2000 Administrator Staff Member

    29,033
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    3:28 PM
    Nginx 1.13.x
    MariaDB 5.5
    FYI, I believe @jscott also uses Centmin Mod on AWS as well so he might have some additional tips :)
     
  4. matt.king

    matt.king New Member

    6
    0
    1
    Aug 27, 2015
    Ratings:
    +0
    Local Time:
    3:28 PM
    I ended up trying a Centos 6 minimum image this morning and had no difficulties. I also had an "ah hah" moment.

    I'd love to gloss over this but i think I had everything blocked in the Amazon security group settings. I use a brand new group and it looked like everything was wide open when in reality everything was shut tight.

    I'm going to go shuffle back into my dark hole now before the pointing and laughing starts.

    [​IMG]
     
  5. eva2000

    eva2000 Administrator Staff Member

    29,033
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    3:28 PM
    Nginx 1.13.x
    MariaDB 5.5
    Last edited: Aug 28, 2015