Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-05-27, 05:38:00

Author Topic: SSH Configure locked me out from server  (Read 3646 times)

0 Members and 1 Guest are viewing this topic.

Offline teodorsavic

  • Valuable Member
  • *
  • Posts: 61
  • Karma: +0/-0
    • View Profile
SSH Configure locked me out from server
« on: 2015-03-11, 04:38:08 »
Hi,
This morning I created authorize keys for my CentOS server, tested them and everything worked fine. I disabled root access, disabled password authentication in httpd.conf file and still everything worked fine.
I needed root access for a minute and I was already logged in to mu KloxoMR panel so went to SSH config and enabled root access from here and that's when it happened.
Now I'm locked out from my server, can't FTP or SSH to it. Nothing. I tried to enable root access and password access but with no success. It's like kloxo is unable to write to httpd.conf anymore.
Is there any way to fix this? Did this happen to anybody before?
Kloxo-MR 7.0.0.b-2015030901, CentOS 6.6 Final

Offline teodorsavic

  • Valuable Member
  • *
  • Posts: 61
  • Karma: +0/-0
    • View Profile
Re: SSH Configure locked me out from server
« Reply #1 on: 2015-03-11, 04:41:41 »
Or is there any other way to access httpd.conf?

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: SSH Configure locked me out from server
« Reply #2 on: 2015-03-11, 04:44:56 »
From 'command center', try 'service sshd restart; service xinetd restart'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: SSH Configure locked me out from server
« Reply #3 on: 2015-03-11, 04:46:10 »
I didn't understand why you need modified httpd.conf directly. Go to 'admin > servers > (localhost) > file manager'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline teodorsavic

  • Valuable Member
  • *
  • Posts: 61
  • Karma: +0/-0
    • View Profile
Re: SSH Configure locked me out from server
« Reply #4 on: 2015-03-11, 05:07:09 »
service sshd restart; service xinetd restart returned:
Stopping sshd: [  OK  ]
Starting sshd: [  OK  ]
Stopping xinetd: [  OK  ]
Starting xinetd: [  OK  ]

I need to access httpd.conf in order to change the values manually:
PermitRootLogin yes/no
PubkeyAuthentication yes/no
To try to get back the access

Offline teodorsavic

  • Valuable Member
  • *
  • Posts: 61
  • Karma: +0/-0
    • View Profile
Re: SSH Configure locked me out from server
« Reply #5 on: 2015-03-11, 06:09:20 »
I've reset all the sshd.conf values:
commented the lines:
#PubkeyAuthentication yes
#AuthorizedKeysFile   .ssh/authorized_keys

PermitRootLogin yes

And I still get the message:
Server unexpectedly closed network connection.

Offline teodorsavic

  • Valuable Member
  • *
  • Posts: 61
  • Karma: +0/-0
    • View Profile
Re: SSH Configure locked me out from server
« Reply #6 on: 2015-03-11, 06:41:59 »
Found the problem!
My home IP address is constantly being added to /etc/hosts.deny. I delete it from here and manage to SSH to the server successfully. The moment I close the SSH connection, my IP is being added to the hosts.deny list again. Could it be that LxGuard is doing this or this is CentOS issue?
I don't have DenyHosts installed on my server (as far as I know)
Tried "/etc/init.d/denyhosts restart" and I got "sh: /etc/init.d/denyhosts: No such file or directory"

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: SSH Configure locked me out from server
« Reply #7 on: 2015-03-11, 07:03:28 »
Blocked/deny automatically add by lxguard. No denyhosts service in CentOS.

Go to lxguard and modified their setting.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline teodorsavic

  • Valuable Member
  • *
  • Posts: 61
  • Karma: +0/-0
    • View Profile
Re: SSH Configure locked me out from server
« Reply #8 on: 2015-03-11, 09:26:26 »
OK, problem solved.
It was LxGuard that blocked me out. It appears that I failed to login too many times. I don't know when and how.
Solution:
Go to LxGuard>Connections and remove your IP from the list (you will probably see it here with the number of failed logins)
Alternative:
Go server>localhost>File Manager and open /etc/hosts.deny. You will see your IP address and you will be able to remove it. This is only temporary though.. You will be able to SSH to your server once (if you need to do something) and the next time you will be locked again.

Thank you very much!

 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix
Click Here

Page created in 0.03 seconds with 21 queries.

web stats analysis