Control Web Panel

WebPanel => CentOS 6 Problems => Topic started by: rs on December 06, 2018, 01:57:58 AM

Title: Can't connect to my server after using logrotate /etc/logrotate.conf
Post by: rs on December 06, 2018, 01:57:58 AM
I have run command
logrotate /etc/logrotate.conf it was defult logrotate.conf but after that my server stop working can't connect through ssh. I am scared...
Title: Re: Can't connect to my server after using logrotate /etc/logrotate.conf
Post by: rs on December 06, 2018, 02:26:30 AM
I have connected through VNC to the server.
Right strange things happened. if I disable iptables I can connect to the server but the command
iptables -S
showing me this result:

Code: [Select]
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT

But since I'm trying to enable iptables I can't connect to the server.
Is that possible that default logrotate configuration file destroyed something important?..
Title: Re: Can't connect to my server after using logrotate /etc/logrotate.conf
Post by: rs on December 06, 2018, 08:20:19 PM
If I disable Firewall from the CWP I can see result of iptables -S like that:

Code: [Select]
iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited

But in the other server with CWP if I disable firewall from the panel the result is just that rules:
Code: [Select]
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT

I have tried to remove this part:
Code: [Select]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited

Using iptable -D

But after enabling firewal I am again loosing access to my server, also if I am disabling firewall again I am getting the same rules:
Code: [Select]
iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
Please help me to understand what´s going on...
Title: Re: Can't connect to my server after using logrotate /etc/logrotate.conf
Post by: rs on December 06, 2018, 10:14:57 PM
Finally, I solved the problem by cleaning the blacklist of the firewall.